Xampy
PHP | SQL | LUA | C++
- Joined
- Jun 22, 2008
- Messages
- 1,109
- Reaction score
- 17
Hello!
I will post for you my script to add or remove the VIP of a player you want to. I don't know if there's any similar script here, but I will post it. If there's any other script like mine, Admins, close this thread if you want to.
Let's go:
TFS 0.2+
Go to data/talkactions/scripts/ and create a file called vip.lua and copy this into the file:
Change the "11551" to the StorageValue of your VIP.
Now, go to data/talkactions/talkactions.xml, open it and put, under <talkactions>:
Now, in your server you must put this commands (in my case, the player name = Xampy):
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TFS 0.3+
Go to data/talkactions/scripts/ and create a file called vip.lua and copy this into the file:
Change the "11551" to the StorageValue of your VIP.
Now, go to data/talkactions/talkactions.xml, open it and put, under <talkactions>:
Now, in your server you must put this commands (in my case, the player name = Xampy):
That's all.:thumbup:
I will post for you my script to add or remove the VIP of a player you want to. I don't know if there's any similar script here, but I will post it. If there's any other script like mine, Admins, close this thread if you want to.
Let's go:
TFS 0.2+
Go to data/talkactions/scripts/ and create a file called vip.lua and copy this into the file:
Code:
function onSay(cid,words,param)
local requiredGroup = 3
local vipStorageValue = [COLOR="DarkOrchid"]11551[/COLOR]
local target = getPlayerByName(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, -1)
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a normal player. '..adminName..' took your V.I.P.')
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 V.I.P. of anyone.")
elseif getPlayerStorageValue(target, vipStorageValue) ~= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not a V.I.P. member.")
end
else
doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
end
end
end
Now, go to data/talkactions/talkactions.xml, open it and put, under <talkactions>:
Code:
<talkaction words="/addvip" script="vip.lua"/>
<talkaction words="/takevip" script="vip.lua"/>
Code:
/addvip "Xampy
/takevip "Xampy
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TFS 0.3+
Go to data/talkactions/scripts/ and create a file called vip.lua and copy this into the file:
Code:
function onSay(cid,words,param)
local requiredGroup = 3
local vipStorageValue = [COLOR="DarkOrchid"]11551[/COLOR]
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, -1)
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a normal player. '..adminName..' took your V.I.P.')
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 V.I.P. of anyone.")
elseif getPlayerStorageValue(target, vipStorageValue) ~= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not a V.I.P. member.")
end
else
doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
end
end
return TRUE
end
Now, go to data/talkactions/talkactions.xml, open it and put, under <talkactions>:
Code:
<talkaction log="yes" words="/addvip" event="script" value="vip.lua"/>
<talkaction log="yes" words="/takevip" event="script" value="vip.lua"/>
Code:
/addvip Xampy
/takevip Xampy
That's all.:thumbup:
Last edited: