CMD:kick(playerid,params[]) { new id,name1[MAX_PLAYER_NAME], reason[35],name2[MAX_PLAYER_NAME], string[128]; if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_LIGHTRED,"SERVER:Nisi admin!"); if(sscanf(params,"uz",id,reason)) return SCM(playerid, COLOR_WHITE,"HELP: /kick [id/Ime_Prezime] [razlog]"); if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_LIGHTRED,"SERVER:Taj igrac nije online."); else { GetPlayerName(playerid,name1,sizeof(name1)); GetPlayerName(id,name2,sizeof(name2)); format(string, sizeof(string),"SERVER: %s je kickan od admina %s, razlog: %s",name2,name1,reason); SendClientMessageToAll(COLOR_RED,string); Kick(id); } return 1; }
if(sscanf(params,"us[129]",id,reason))
CMD:kick(playerid, params[]) { if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command."); new reason[128], giveplayerid; if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command."); if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /kick [player id] [reason]"); if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected."); format(reason, sizeof(reason), "Admin %s Kicked %s [Reason : %s ]", GetNameEx(playerid), GetNameEx(giveplayerid), reason); SendClientMessageToAll(COLOUR_LIGHTRED, reason); Kick(giveplayerid); return 1; } |
IsPlayerLoggedIn[MAX_PLAYERS];
//OnPlayerConnect
IsPlayerLoggedIn[playerid]=0;
//After ur login proceeds:
IsPlayerLoggedIn[playerid]=1;
//OnPlayerDisconnect
IsPlayerLoggedIn[playerid]=0;
//Ur cmd
if(IsPlayerLoggedIn[playerid]==0) return SendClientMessage(/*your message that hes not online*/);