Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. -- this a global table within the script
  2. local killTable = {}
  3. local timer = 30 -- time in seconds
  4.  
  5. function populate(cid, target, seconds)
  6.     locla ip = getPlayerIp(target)
  7.     if not killTable[cid] == ip then
  8.         killTable[cid] = ip
  9.         addEvent(
  10.             function(cid)
  11.                 killTable[cid] = 0
  12.             end,
  13.             seconds * 1000,
  14.             cid
  15.         )
  16.         return true
  17.     end
  18.     return false
  19. end
  20.  
  21.  
  22. -- 2nd script
  23. function onKill(cid, target, lastHit)
  24.     if cid ~= target and isPlayer(target)  then
  25.         if getPlayerIp(cid) == getPlayerIp(target) then
  26.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You will be punished for killing a player of the same IP and will not recieve the reward.')
  27.         else
  28.             if populate(cid, target, timer) then
  29.                 doPlayerAddItem(cid, 2159, 1)
  30.             end
  31.         end
  32.     end
  33.     return true
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement