[HELP]Why do i get this ? [zcmd] -
DaRkAnGeL[NBK] - 19.10.2011
Hey,
how come i get an error with this ? i don't get this error on my other script so im wondering why and what i have done cos i cant work it out
pawn Код:
CMD:ban(playerid,params[])
{
new
pID,
reason[70]
;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_YELLOW,"You Must Be An Admin To Use This Command");
else if(IsPlayerConnected(pID)) SendClientMessage(playerid,COLOR_YELLOW,"This Player Is Not Connected!");
else if(pID == playerid) = SendClientMessage(playerid,COLOR_YELLOW,"You Cannot Ban Yourself!");
else if(sscanf(params, "uS(No Reason)[40]", pID, reason)) SendClientMessage(playerid,COLOR_YELLOW, "[USAGE]: /ban playerid reason");
else
{
BanEx(pID,reason);
Kick(pID);
PlayerInfo[pID][pBanned] = 1;
}
return 1;
}
Re: [HELP]Why do i get this ? [zcmd] -
nilanjay - 19.10.2011
What's the error?
Re: [HELP]Why do i get this ? [zcmd] -
DaRkAnGeL[NBK] - 19.10.2011
Код:
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(155) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(156) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(156) : warning 215: expression has no effect
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(156) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
sorry for got to include
Re: [HELP]Why do i get this ? [zcmd] -
nilanjay - 19.10.2011
Try this
pawn Код:
CMD:ban(playerid, params[])
{
if(PInfo[playerid][pAdminLevel] < 3) return SendClientMessage(playerid,ORANGE,"You need to be level 3 to use this command!");
new id,name[MAX_PLAYER_NAME],aname[MAX_PLAYER_NAME];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban <playerid/name>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREY,"Invalid ID");
GetPlayerName(id,name,sizeof(name));
GetPlayerName(playerid,aname,sizeof(aname));
new str[80];
format(str,sizeof(str),"%s has banned %s",aname,name);
SendClientMessageToAll(ORANGE,str);
Ban(id);
return 1;
}
Re: [HELP]Why do i get this ? [zcmd] -
DaRkAnGeL[NBK] - 19.10.2011
Код:
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(149) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(149) : warning 215: expression has no effect
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(149) : error 001: expected token: ";", but found "]"
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(149) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(149) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
same kind of errors for some reason
Re: [HELP]Why do i get this ? [zcmd] -
nilanjay - 19.10.2011
Which is line 149?
Re: [HELP]Why do i get this ? [zcmd] -
DaRkAnGeL[NBK] - 19.10.2011
nope still errors -.-
pawn Код:
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(151) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(151) : warning 215: expression has no effect
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(151) : error 001: expected token: ";", but found "]"
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(151) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SAMP\Midnight Drifts\gamemodes\login.pwn(151) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Re: [HELP]Why do i get this ? [zcmd] -
nilanjay - 19.10.2011
Which is line 151?
Re: [HELP]Why do i get this ? [zcmd] -
DaRkAnGeL[NBK] - 19.10.2011
line 149 is the { and line 151 is the
pawn Код:
if(pInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,COLOR_YELLOW,"You need to be level 3 to use this command!");
Re: [HELP]Why do i get this ? [zcmd] -
DaRkAnGeL[NBK] - 19.10.2011
got the error's sorted it change [pInfo] to [PlayerInfo] Thanks for your help XD