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
return -1
end