Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. function main()
  2.     repeat wait(0) until isSampAvailable()
  3.     wait(2000)
  4.     sampAddChatMessage('{FF00D6} NEWID by Bernardooo! {00F4FF}SCRIPT HAS LOADED!! USE //id',-1 )
  5.     sampRegisterChatCommand('//newid', newfuncs)
  6.     wait(-1)
  7. end
  8.  
  9. function newfuncs(id)
  10.     if id == "" then
  11.         sampAddChatMessage('{FF00D6}[NEWID]:{00DD00} Используй //id [PlayerId]', -1)
  12.     else
  13.         result = sampIsPlayerConnected(id)
  14.                 if not result then
  15.             sampAddChatMessage('{FF00D6}[NEWID]:{00DD00}Игрок не в сети или неверно указан ID.', -1)
  16.         else
  17.             local nick = sampGetPlayerNickname(id)
  18.             local result = sampIsPlayerNpc(id)
  19.             if result then
  20.             npc = 'Да'
  21.         else
  22.             npc = 'Нет'
  23.         end
  24.         result_afk = sampIsPlayerPaused(id)
  25.         if result then
  26.             afk = 'В AFK'
  27.         else
  28.             npc = 'Нет'
  29.         end
  30.             if afk==nil then
  31.             afk='В игре.'
  32.         end
  33.         local ping = sampGetPlayerPing(id)
  34.         sampAddChatMessage('{CEC0CC}[{FF00D6}NEWID{CEC0CC}]{00DD00}NICK: {D9D4D9}'..nick..' {00DD00}'..afk..' {00DD00}PING:{D9D4D9}'..ping, -1)
  35.     end
  36.     function sampGetPlayerIdByNickname(nick) local _, myid = sampGetPlayerIdByCharHandle(playerPed) if tostring(nick) == sampGetPlayerNickname(myid) then return myid end for i = 0, 1000 do if sampIsPlayerConnected(i) and sampGetPlayerNickname(i) == tostring(nick) then return i end end end
  37. end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement