pinfo help
#1

okay I am first time working with pInfo.. can anyone help me?

I got this command
PHP код:
if(strcmp("/kick"cmdtexttrue) == 0)
    {
        if(
pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playeridCOLOR_RED"<!>You are not TDM administrator!");
        {
            new 
cmd[256], idx;
            
cmd strtok(cmdtextidx);
            if(
strcmp(cmd"/kick"true) == 0)
            {
                new 
tmp[256];
                
tmp strtok(cmdtextidx);
                if(
strlen(tmp) == 0) return SendClientMessage(playeridCOLOR_RED"<!>Usage: /kick [playerid]");
                
Kick(strval(tmp));
                return 
1;
            }
        }
    } 
I get tons of errors for the first line there
PHP код:
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : error 028invalid subscript (not an array or too many subscripts): "pInfo"
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : warning 215expression has no effect
D
:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : error 001expected token";"but found "]"
D:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : error 029invalid expressionassumed zero
D
:\Igre\SAMP Serveri\0.3c\gamemodes\TDM.pwn(643) : fatal error 107too many error messages on one line 
This is my enum
PHP код:
enum pInfo
{
    
bool:SpawnDance,
    
Float:SpawnAngle,
    
SpawnTimer,
    
pAdminLevel,
    
pCash,
    
pScore
}; 
Reply
#2

pawn Код:
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "<!>You are not TDM administrator!"); //ERROR LINE
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/kick", true) == 0)
    {
        new tmp[256];
        tmp = strtok(cmdtext, idx);
        if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_RED, "<!>Usage: /kick [playerid]");
        Kick(strval(tmp));
        return 1;
    }
}
Reply
#3

same errors :P



Edit: RESOLVED
I re-defined pInfo with new again
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)