15.12.2010, 08:51
Hi all,i've 2 problems.
I created /kick cmd,i need add the reason too.
Ex: /kick playerid reason
And,i've my registration system with admin levels.
and the final code is:
But i got errors:
The enum of my registration system is:
Thanks.
I created /kick cmd,i need add the reason too.
Ex: /kick playerid reason
And,i've my registration system with admin levels.
and the final code is:
Код:
if(strcmp("/kick", cmdtext, true, 5) == 0) { if(pInfo[playerid][AdminLevel] > 0) if(!strlen(cmdtext[6])){ return SendClientMessage(playerid, COLOR_RED, "Correct usage: /kick [player id]"); } new targetid = strval(cmdtext[6]); if(IsPlayerConnected(targetid)){ new string[128], playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, MAX_PLAYER_NAME); GetPlayerName(targetid, targetname, MAX_PLAYER_NAME); format(string, 128, "Admin %s kicked you from the server.", playername); SendClientMessage(targetid, COLOR_YELLOW, string); Kick(targetid); format(string, 128, "Admin %s kicked %s from the server.", playername, targetname); SendClientMessageToAll(0xFFAA00AA, string); } else{ return SendClientMessage(playerid, 0xFFAA00AA, "That player is not connected."); } } else{ return SendClientMessage(playerid, 0xFFAA00AA, "No."); } return 1; }
Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : error 028: invalid subscript (not an array or too many subscripts): "pInfo" C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : warning 215: expression has no effect C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : error 001: expected token: ";", but found "]" C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : error 029: invalid expression, assumed zero C:\Documents and Settings\k\Desktop\SFWAR.pwn(171) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Код:
enum pInfo { AdminLevel, Cash, Score, }