03.06.2012, 21:01
pawn Код:
if(!strcmp(cmdtext, "/ban", true, 4))
{
if(Admin[playerid] >= 2 )
{
if(!strlen(cmdtext[5]))
{
SendClientMessage(playerid, COLOR_RED, "[Usage] /ban [playerid]");
return 1;
}
new ID = strval(cmdtext[5]);
new banmsg[170];
new banmsgg[171];
if(IsPlayerConnected(ID))
{
format(banmsg, 170, "You have been banned!");
format(banmsgg, 171, "If you think this is done with no reason. Report the admin");
SendClientMessage(ID,COLOR_ORANGE, banmsg);
SendClientMessage(ID,COLOR_ORANGE, banmsgg);
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has been banned by admin!",pName);
Banned[pName]++; // <---- The problem is in this line ( It should give in the players .sav file a Banned=1 )
SendClientMessageToAll(COLOR_RED,string);
Kick(playerid);
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You are not an admin!");
}
return 1;
}
pawn Код:
C:\Users\Marko\Desktop\SA-MP Server\gamemodes\TestGM.pwn(2307) : error 033: array must be indexed (variable "pName")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.