24.05.2015, 14:09
Hello, this is my Script!
My problem is that, if I make /setlevel (my id) (level) as Rcon Admin it says: Player not found
please help me, thx
Код:
CMD:setlevel(playerid, params[]) { new level, id; if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, RED, "[USAGE]: /setlevel [name/id] [level]"); if(!IsPlayerConnected(id) ) return SendClientMessage(playerid, RED, "Player not found."); if(IsLoggedIn{id} == 0) return SendClientMessage(playerid, RED, "Player not logged in."); if(IsPlayerAdmin(playerid)) { PlayerInfo[id][aLevel] = level; PlayerPlaySound(id,1085,0.0,0.0,0.0); format(fstr, sizeof(fstr), "You have set %s [%d] admin level to %d.", GetName(id), id, level); SendClientMessage(playerid, YELLOW, fstr); format(fstr, sizeof(fstr), "Admin %s [%d] has set your admin level to %d.", GetName(playerid), playerid, level); SendClientMessage(id, LIGHTGREEN, fstr); SaveUserStats(id); } else if(PlayerInfo[playerid][aLevel] == 4) { PlayerInfo[id][aLevel] = level; PlayerPlaySound(id,1085,0.0,0.0,0.0); format(fstr, sizeof(fstr), "You have set %s [%d] admin level to %d.", GetName(id), id, level); SendClientMessage(playerid, YELLOW, fstr); format(fstr, sizeof(fstr), "Admin %s [%d] has set your admin level to %d.", GetName(playerid), playerid, level); SendClientMessage(id, LIGHTGREEN, fstr); SaveUserStats(id); } else { SendClientMessage(playerid, RED, "Only admin level 4 can use this command."); } return true; }
please help me, thx