CMD:kick(playerid, params[]) { if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, RAUDONA, "KLAIDA: {559ABD}Tik Kūrėjų Komanda gali naudoti љią komandą!"); new userid, reason[128], string[128]; new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Adminname, sizeof(Adminname)); GetPlayerName(userid, Playername, sizeof(Playername)); if (sscanf(params, "us[64]", userid, reason))return SendClientMessage(playerid, MELYNA, "Naudojimas: /kick [ID] [Prieћastis]"); if(!IsPlayerConnected(userid))return SendClientMessage(playerid, RAUDONA, "Tokio ћaidėjo nėra!"); format(string, sizeof(string), "[KICK] Administratorius %s iљmetė %s iљ serverio. (Prieћastis: %s)", Adminname, Playername, reason); SendClientMessageToAll(GELTONA, string); Kick(userid); return 1; } |
GetPlayerName(userid, Playername, sizeof(Playername)); should be called after sscanf statement otherwise userid is 0
|