Script Error
#1

Hey Guys, I've error, but I don't know whats wrong, and how to fix it ?
This is the error:
Код:
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(4437) : warning 215: expression has no effect
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(4437) : error 001: expected token: ";", but found "["
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(4437) : error 029: invalid expression, assumed zero
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(4437) : warning 215: expression has no effect
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(4437) : error 001: expected token: ";", but found "]"
C:\Users\ariefkyano\Desktop\Test RP\gamemodes\Respect4.pwn(4437) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
And, the code:
pawn Код:
GivePlayerValidWeapon( playerid, WeaponID, Ammo )
{
    if((PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
    switch( WeaponID )
    {
        case 0, 1:
        {
            PlayerInfo[playerid][pGuns][ 0 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 0 ] = Ammo; //This is the error line.
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 2, 3, 4, 5, 6, 7, 8, 9:
        {
            PlayerInfo[playerid][pGuns][ 1 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 1 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 22, 23, 24:
        {
            PlayerInfo[playerid][pGuns][ 2 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 2 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 25, 26, 27:
        {
            PlayerInfo[playerid][pGuns][ 3 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 3 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 28, 29, 32:
        {
            PlayerInfo[playerid][pGuns][ 4 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 4 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 30, 31:
        {
            PlayerInfo[playerid][pGuns][ 5 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 5 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 33, 34:
        {
            PlayerInfo[playerid][pGuns][ 6 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 6 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 35, 36, 37, 38:
        {
            PlayerInfo[playerid][pGuns][ 7 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 7 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 16, 17, 18, 39, 40:
        {
            PlayerInfo[playerid][pGuns][ 8 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 8 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 41, 42, 43:
        {
            PlayerInfo[playerid][pGuns][ 9 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 9 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 10, 11, 12, 13, 14, 15:
        {
            PlayerInfo[playerid][pGuns][ 10 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 10 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
        case 44, 45, 46:
        {
            PlayerInfo[playerid][pGuns][ 11 ] = WeaponID;
            PlayerInfo[playerid][pGunsAmmo][ 11 ] = Ammo;
            GivePlayerWeapon( playerid, WeaponID, Ammo );
        }
    }
    return 1;
}
Reply
#2

pawn Код:
PlayerInfo[playerid][pGunsAmmo][ 0 ] = Ammo; //This is the error line.
but try this
pawn Код:
PlayerInfo[playerid][pGunsAmmo][ 0 ] = Ammo); //This is the error line.
Reply
#3

That wouldn't work, if anything it would create more errors. Show where you create the new variable in the enum, new variable being pGunsAmmo.
Reply
#4

BUMP...
Reply
#5

Quote:
Originally Posted by Ryox175
Посмотреть сообщение
pawn Код:
PlayerInfo[playerid][pGunsAmmo][ 0 ] = Ammo; //This is the error line.
but try this
pawn Код:
PlayerInfo[playerid][pGunsAmmo][ 0 ] = Ammo); //This is the error line.
WTF are you saying?! It will create more probles.
The error could be that the variable in the second brackets doesn't exist.
Reply
#6

Show the enum HouseInfo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)