25.07.2009, 13:50
Код:
if ( strcmp ( cmd , "/kick" , true ) == 0 && IsPlayerAdmin ( playerid ) ) { new tmp [ 256 ]; new message [ 256 ]; tmp = strtok ( cmdtext , idx ); if( ! strlen ( tmp ) ) { SendClientMessage ( playerid , COLOR_WHITE , "USAGE: /kick [playerid]" ); return 1; } new giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { if (IsPlayerConnected(giveplayerid)) { SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________"); format(string, sizeof(string), "*** %s has been kicked / dostał kicka. (player: %d) / (Reason/Powуd: %s.)",GetName(giveplayerid), giveplayerid, message); SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________"); Kick(giveplayerid); return 1; } else { format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } } if(giveplayerid < 10) { strmid(message, cmdtext, 7, strlen(cmdtext)); } else { strmid(message, cmdtext, 8, strlen(cmdtext)); } if (IsPlayerConnected(giveplayerid)) { SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________"); format(string, sizeof(string), "*** %s has been kicked / dostał kicka. (player: %d) / (Reason/Powуd: %s.)",GetName(giveplayerid), giveplayerid, message); SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________"); Kick(giveplayerid); return 1; } else { format(string, sizeof(string), "[ERROR] ID %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } }
Код:
_______________________________________________ _______________________________________________
Thanks and Regards
Puzi