28.10.2010, 07:46
pawn Код:
dcmd_kick(playerid,params[]){
if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, COLOUR_RED, "You need to be admin to use this command");
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, COLOUR_RED, "Usage: /kick [ID] [Reason]") &&
SendClientMessage(playerid, COLOUR_RED, "NOTE: You don't have to put the reason if you don't want to");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][AdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
if(!strlen(tmp2))
{
format(string,sizeof(string),"%s got kicked by Administrator %s . Reason:No reason given",playername,adminname);
SendClientMessageToAll(COLOUR_ORANGE,string);
return Kick(player1);
}
else
{
format(string,sizeof(string),"%s got kicked by Administrator %s . Reason: %s.",playername,adminname,params[2]);
SendClientMessageToAll(COLOUR_ORANGE,string);
return Kick(player1);}}}
Код:
C:\DOCUME~1\gazdeki\Desktop\FLHP0~1.3B\FILTER~1\MEANAD~2.PWN(317) : warning 209: function "dcmd_kick" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.