• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Scripts needed!! REP++

Pedroo

New Member
Joined
Sep 16, 2009
Messages
8
Reaction score
0
Hello. I've been searching everywhere but I can't find what I want, so I'll ask you guys to see if someone can help me.

Vip system by using a VIP medal (15 days vip). Auto promote the character. Also, an manual command to give a determinate number of vip days to a character, and a command to remove the vip imediattely. Also if possible a !vipcheck command for the players. ^_^

Doubt:

Is there a way to make a command to do /senditem player, id and the item goes to the players depot?

THANK YOU FOR THE HELP! I REALLY APRECIATE!
 
Vip system was already released many times, you can find good vip system by Shawak in Lua Functions section.


About your doubt: Yes, it's possible.
 
@Chojrak

I know.. I searched them up but I can't find a way to make it do what I need. I don't understand the script from Shawak because I can't find where do I set the vip medals id, and how to make it promote the player.

Here is the script.. If you can tell me where can I change those things above I would appreciate very much:

Code:
local days = 30
local levelToBeVIP = 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerLevel(cid) >= levelToBeVIP then
                if isPlayerVip(cid) == FALSE then
                        doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for "..days.." days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
                end
                doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED) 
                doPlayerAddVipDays(cid, days)
                doRemoveItem(item.uid, 1)
                doSendAnimatedText(getCreaturePosition(cid), "+"..days.." days VIP", 30)
        else
                doPlayerSendCancel(cid, "You need level "..levelToBeVIP.." to be a VIP player.")
        end     
        return TRUE
end

And about the send command.. If it's possible, can you try to do it please? Like /senditem player, id and it sends to the players depot.

Thank you!
 
Vip Door Script:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
		if (item.actionid == 8789 and getPlayerStorageValue(cid,19551) >= 1) then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
			else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP from Admin Flamming.")
			return TRUE
	end
	return FALSE
end

On xml:

<action actionid="8789" script="scriptname.lua" />

VIP Script:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
    -- if getPlayerStorageValue(cid,19551) < 1 then
        if getPlayerLevel(cid) > 1 then
            getPlayerStorageValue(cid, 19551)
            doSendAnimatedText(getPlayerPosition(cid), ".V.I.P.!", TEXTCOLOR_RED)
            doSendMagicEffect(getPlayerPosition(cid),27)
            doCreatureSay(cid, "CONGRATULATIONS " ..  name .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!", TALKTYPE_ORANGE_1)
            doBroadcastMessage("CONGRATULATIONS " ..  name .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!")
            setPlayerStorageValue(cid, 19551, (getPlayerStorageValue(cid,19551) + 15))
	    doSendMagicEffect(getPlayerPosition(cid),27)
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
            doRemoveItem(item.uid, 1)
        end
    -- else
    --    doPlayerSendCancel(cid,"You have already used this medal.")
    -- end    
return TRUE
end

On Actions XML:

<action itemid="medal id" script="scriptname.lua"/>

/addvip command script:

LUA:
function onSay(cid,words,param)

local requiredGroup = 5

local vipStorageValue = 19551

local target = getPlayerByNameWildcard(param)

	if words == '/addvip' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, vipStorageValue) == -1 then 
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, vipStorageValue, 1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a V.I.P. member. '..adminName..' gave you the V.I.P.') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made a V.I.P. member to "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't make V.I.P. member to anyone.")
			
		elseif getPlayerStorageValue(target, vipStorageValue) ~= -1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is already a V.I.P. member.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
		

	elseif words == '/takevip' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, vipStorageValue) == 1 then
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, vipStorageValue, -19551)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a normal player. '..adminName..' took your VIP') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You took the V.I.P. of "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't take the VIP of anyone.")
			
		elseif getPlayerStorageValue(target, vipStorageValue) ~= 19551 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not a VIP member.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
end		
return TRUE
end

on talkactions.xml

<talkaction log="yes" access="5" words="/addvip" script="scriptname.lua"/>
<talkaction log="yes" access="5" words="/removevip" script="scriptname.lua"/>

REP++ if i helped you! :D:wub::thumbup:
 
You have to change it in actions.xml in script refference.
And about promote, use function doPlayerSetPromotionLevel(cid, level).
As third if you want to add depot item, you have to kick player then execute MySQL query, so without kick it's not possible. Anyway you can use doPlayerAddItem(cid, itemid[, count/subtype[, canDropOnMap]]) so player will receive item without kick, but not to depot :P
 
@Lava Titan

Testing... Answer in a sec

@Chojrak

Is there a way to send it to the players depot when he is offline right? I'm getting alot of players on my server so I can't check if players are online or not.. Is there another way to make the item "hold in queue"? Like wait for the logout and then appear on the depot?
 
For offline:
Code:
function onSay(cid, words, param, channel)
	local params = string.explode(param, ",")
	if (not params[1] or not params[2]) then
		doPlayerSendCancel(cid, "Command require 2 params.")
		return true
	end

	local player = getPlayerByName(params[2])
	local item = getItemNameById(params[2])

	if (not player) then
		db.executeQuery("INSERT INTO `player_depotiems` VALUES (".. getPlayerGUID(player) ..", 1, 0, 0, params[2], 1)")
		doPlayerSendCancel(cid, "Item ".. item .." added to ".. params[1] .."'s depot #1.")
	else
		doPlayerSendCancel(cid, "Sorry, but player is online.")
	end

	return true
end

If you want queue just add addEvent with params, and repeat addEvent until player log out.
 
@Shawak

He stoled the scripts? OMG :blink:

@Chojrak

I will add that on talkactions/scripts right? And then add a tag on the talkactions.xml..

I didn't understand the
If you want queue just add addEvent with params, and repeat addEvent until player log out.

Thank you for the pacience! :p
 
I got this on the console.. :confused:

[16/09/2009 18:37:45] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/vip.lua)
[16/09/2009 18:37:45] data/actions/scripts/vip.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'
[16/09/2009 18:37:47] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/vip/set.lua)
[16/09/2009 18:37:47] cannot open data/talkactions/scripts/vip/set.lua: No such file or directory
[16/09/2009 18:37:47] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/vip/get.lua)
[16/09/2009 18:37:47] cannot open data/talkactions/scripts/vip/get.lua: No such file or directory
[16/09/2009 18:37:47] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/vip/add.lua)
[16/09/2009 18:37:47] cannot open data/talkactions/scripts/vip/add.lua: No such file or directory
[16/09/2009 18:37:47] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/vip/remove.lua)
[16/09/2009 18:37:47] cannot open data/talkactions/scripts/vip/remove.lua: No such file or directory
 
Vip Door Script:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
		if (item.actionid == 8789 and getPlayerStorageValue(cid,19551) >= 1) then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
			else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP from Admin Flamming.")
			return TRUE
	end
	return FALSE
end

On xml:



VIP Script:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
    -- if getPlayerStorageValue(cid,19551) < 1 then
        if getPlayerLevel(cid) > 1 then
            getPlayerStorageValue(cid, 19551)
            doSendAnimatedText(getPlayerPosition(cid), ".V.I.P.!", TEXTCOLOR_RED)
            doSendMagicEffect(getPlayerPosition(cid),27)
            doCreatureSay(cid, "CONGRATULATIONS " ..  name .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!", TALKTYPE_ORANGE_1)
            doBroadcastMessage("CONGRATULATIONS " ..  name .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!")
            setPlayerStorageValue(cid, 19551, (getPlayerStorageValue(cid,19551) + 15))
	    doSendMagicEffect(getPlayerPosition(cid),27)
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
            doRemoveItem(item.uid, 1)
        end
    -- else
    --    doPlayerSendCancel(cid,"You have already used this medal.")
    -- end    
return TRUE
end

On Actions XML:



/addvip command script:

LUA:
function onSay(cid,words,param)

local requiredGroup = 5

local vipStorageValue = 19551

local target = getPlayerByNameWildcard(param)

	if words == '/addvip' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, vipStorageValue) == -1 then 
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, vipStorageValue, 1)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a V.I.P. member. '..adminName..' gave you the V.I.P.') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made a V.I.P. member to "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't make V.I.P. member to anyone.")
			
		elseif getPlayerStorageValue(target, vipStorageValue) ~= -1 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is already a V.I.P. member.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
		

	elseif words == '/takevip' then	
	
		if target > 0 then
		if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, vipStorageValue) == 1 then
			adminName = getPlayerName(cid) 		
			setPlayerStorageValue(target, vipStorageValue, -19551)			
			doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a normal player. '..adminName..' took your VIP') 			
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You took the V.I.P. of "..param..".")			

		elseif getPlayerGroupId(cid) < requiredGroup then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't take the VIP of anyone.")
			
		elseif getPlayerStorageValue(target, vipStorageValue) ~= 19551 then		
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not a VIP member.")
		end
		else
				doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
		
		end
end		
return TRUE
end

on talkactions.xml



REP++ if i helped you! :D:wub::thumbup:

makes a scripter that when you speak.! vipdays tells how many days have vip still has:ninja:
 
Back
Top