Hello, I'm adding simple function to kick player, can be used for any raids, hunting rooms etc. I will also publish some scripts where I have used this function soon.
Library:
- storage must be a number, 0 if you won't use storage (just a teleport after X sec).
- time must be a number, cannot be lower than 0 (0 if you want instant teleport).
- msg must be a string "Simple message" or 'Simple message'.
- pos must be a table, where player will be teleported after time {x = 0, y = 0, z = 0}.
Example:
doPlayerKick(cid, 30000, 6000, "You has been moved to jail cause of chargeback.", {x = 1000, y = 1000, z = 7})
Player with Storage 30000 and Value 1 will be moved after 6 sec to possition {x = 1000, y = 1000, z = 7}, He also will see a message "You has been moved to jail cause of chargeback.".
FAQ:
Why have you used storage?
- Becuse someone may want to check the player if already killed X monster or leaved area (For example you have 10 sec to kill rat if you won't do it you will be teleported if you will do it and you will also add creaturescripts onKill doPlayerSetStorageValue(cid, storage, -1) player won't be teleported, system will ignore him).
- There is also alternative way without storage ^_^, just write 0.
How time works here?
- Just a 1000 ms = 1 sec so if you want to kick after 10 sec you have to write 10000.
Why have you wrote it?
- As i said i have used it to some scripts, i was so lazy to write it same like 20 times.
How can i set the possition to teleport?
- Just use a table {x = 0, y = 0, z = 0}.
Why didn't you use a check value if it isn't nil and correct type()?
- Because I believe that you are not a monkey, and you will spend like 1 min to read info about it.
I know it is really easy to write, but i think it will be usefull.
Hope you like it ^_^.
Changelog:
- Added creature check isCreature(cid).
Lua:
function doPlayerKick(cid, storage, time, msg, pos)
addEvent(
function()
if isCreature(cid) then
if storage == 0 then
doTeleportThing(cid, pos)
doCreatureSay(cid, msg, TALKTYPE_ORANGE_1)
else
if getPlayerStorageValue(cid, storage) == 1 then
doTeleportThing(cid, pos)
doCreatureSay(cid, msg, TALKTYPE_ORANGE_1)
doPlayerSetStorageValue(cid, storage, -1)
end
end
end
return true
end,
time
)
return true
end
Library:
- storage must be a number, 0 if you won't use storage (just a teleport after X sec).
- time must be a number, cannot be lower than 0 (0 if you want instant teleport).
- msg must be a string "Simple message" or 'Simple message'.
- pos must be a table, where player will be teleported after time {x = 0, y = 0, z = 0}.
Example:
doPlayerKick(cid, 30000, 6000, "You has been moved to jail cause of chargeback.", {x = 1000, y = 1000, z = 7})
Player with Storage 30000 and Value 1 will be moved after 6 sec to possition {x = 1000, y = 1000, z = 7}, He also will see a message "You has been moved to jail cause of chargeback.".
FAQ:
Why have you used storage?
- Becuse someone may want to check the player if already killed X monster or leaved area (For example you have 10 sec to kill rat if you won't do it you will be teleported if you will do it and you will also add creaturescripts onKill doPlayerSetStorageValue(cid, storage, -1) player won't be teleported, system will ignore him).
- There is also alternative way without storage ^_^, just write 0.
How time works here?
- Just a 1000 ms = 1 sec so if you want to kick after 10 sec you have to write 10000.
Why have you wrote it?
- As i said i have used it to some scripts, i was so lazy to write it same like 20 times.
How can i set the possition to teleport?
- Just use a table {x = 0, y = 0, z = 0}.
Why didn't you use a check value if it isn't nil and correct type()?
- Because I believe that you are not a monkey, and you will spend like 1 min to read info about it.
I know it is really easy to write, but i think it will be usefull.
Hope you like it ^_^.
Changelog:
- Added creature check isCreature(cid).
Last edited: