26.07.2016, 20:12
pawn Код:
CMD:kick(playerid,params[]) {
if(IsPlayerAdmin(playerid))
{
new tmp[256], tmp2[256], Index;
tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "Koristi: /kick [playerid] [reason]"); //Check If Player Does Not Added "Reason and the ID"
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp); // << player1 = ID of The Player
if(!IsPlayerConnected(player1)) return SendClientMessage(playerid,0xFF0000AA,"Igrac nije online"); //<< Check If Player Connected Or Not
GetPlayerName(player1, playername, sizeof(playername)); //get Selected Player Name
GetPlayerName(playerid, adminname, sizeof(adminname)); //get Admin Name Who Use This command
format(string,sizeof(string),"Admin %s je kikovao %s | Razlog ( %s )",adminname,playername,params[2]); //adminname = the player Who Use This command || playername = the Player who Going To Be kicked || params[2] = The Reason Of The Kick
SendClientMessageToAll(0xFF0000AA,string); // Send Message To all Players.
Kick(player1);
} else return SendClientMessage(playerid,0xFF0000AA,"Nemozes koristiti tu komandu!"); // This Code return the Player IF he's not Login in as RCON admin
return 1;
}
pawn Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(460) : error 021: symbol already defined: "strtok"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(475) : error 047: array sizes do not match, or destination array is too small