Originally Posted by XStormiest
wrong
pawn Код:
CMD:rkick(playerid, params[])
{
new pID, reason[128], string[256], pName1[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"You are not Rcon Admin!");
if(sscanf(params,"us[128]",pID,reason)) return SendClientMessage(playerid,-1, "[USAGE]:/rkick [Playerid/PartOfName] [Reason]");
if (pID==INVALID_PLAYER_ID)SendClientMessage(playerid,-1,"[ERROR]:Player not found!");
else if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,-1,"[ERROR]:Player is not Connected!");
else
{
GetPlayerName(playerid, pName1, sizeof(pName1));
GetPlayerName(pID, pName2, sizeof(pName2));
format(string, sizeof(string),"Rcon Admin %s has RKICK %s from this server ( Reason: %s )", pName1, pName2, reason);
SendClientMessageToAll(-1, string);
}
return 1;
}
where is Kick(pID); ??.....
+ recomand you using foreach in next version gg nice for a begginer..
pawn Код:
CMD:rkick(playerid, params[])
{
new pID, reason[128], string[256], pName1[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"You are not Rcon Admin!");
if(sscanf(params,"us[128]",pID,reason)) return SendClientMessage(playerid,-1, "[USAGE]:/rkick [Playerid/PartOfName] [Reason]");
if (pID==INVALID_PLAYER_ID)SendClientMessage(playerid,-1,"[ERROR]:Player not found!");
else if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,-1,"[ERROR]:Player is not Connected!");
else
{
GetPlayerName(playerid, pName1, sizeof(pName1));
GetPlayerName(pID, pName2, sizeof(pName2));
format(string, sizeof(string),"Rcon Admin %s has RKICK %s from this server ( Reason: %s )", pName1, pName2, reason);
SendClientMessageToAll(-1, string); Kick(pID); }
return 1;
}
|