Got some errors
#1

I got 5 errors in this

PHP код:
CMD:******(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playeridCOLOR_GREY"You are not an authorized to use this command.");
    new 
string[128];
    if(!
strcmp(params"all"true))
    {
        new 
string[126],string2[126];
        
format(stringsizeof(string), "{FF0000}[Admin]{FF6347} %s has checked everybody online for sobiet hacks."NORPN(playerid));
        
SendClientMessageToAll(COLOR_LIGHTREDstring);
        foreach(
Playeri)
        {
            for(new 
i=0i<13i++)
            {
                   
GetPlayerWeaponData(piweapons[i][0], weapons[i][1]);
                if(
weapons[i][0] != PlayerInfo[p][pWeapon][i] && weapons[i][0] != PlayerInfo[playerb][pWeapon][i] && weapons[i][1] != 0)
                {
                    
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s is hacking a %s. (Global sobiet check by %s)"NORPN(p), RWN(weapons[i][0]), NORPN(playerid));
                    
SendAdminMessage(COLOR_DARKRED1string);
                }
            }
        }
        return 
1;
    }
    if(
sscanf(params"u"playerb)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /sobiet [playerid/all]");
    if(!
IsPlayerLoggedIn(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player id.");
    
format(string2sizeof(string2), "{FF0000}[Admin Warn]{FF6347} %s has checked %s for sobiet hacks."NORPN(playerid), NORPN(playerb));
    
SendAdminMessage(COLOR_DARKRED1string);
    for(new 
i=0i<13i++)
    {
        
GetPlayerWeaponData(playerbiweapons[i][0], weapons[i][1]);
        if(
weapons[i][0] != PlayerInfo[playerb][pWeapon][i])
        {
             
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s is hacking a %s. (Specific sobiet check by %s)"NORPN(playerb), RWN(weapons[i][0]), NORPN(playerid));
            
SendAdminMessage(COLOR_DARKRED1string);
        }
    }
    return 
1;

Errors:

PHP код:

C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(5051) : warning 215expression has no effect
C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(5084) : warning 215expression has no effect
C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(5114) : warning 215expression has no effect
C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43524) : error 017undefined symbol "NORPN"
C:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43528) : warning 219local variable "i" shadows a variable at a preceding level
C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43530) : error 017undefined symbol "p"
C:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43530) : warning 215expression has no effect
C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43530) : error 001expected token";"but found "]"
C:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43530) : error 029invalid expressionassumed zero
C
:\Users\Thomas Williams\Desktop\Our Server\gamemodes\GTA.pwn(43530) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
5 Errors

Reply
#2

pawn Код:
foreach(Player, i)
{
    for(new i=0; i<13; i++)
You can't use i for both. Change the one to another name. Also about:
pawn Код:
NORPN(p)
Copy the NORPN function from where you copied the above line and change p to the variable's name foreach uses.
Reply
#3

Can't you just edit it for me because, I kinda have no clue
Reply
#4

You need to define the variables first of all...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)