SA-MP Forums Archive
Expected token ";", but found "["...How to fix this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Expected token ";", but found "["...How to fix this? (/showthread.php?tid=360983)



Expected token ";", but found "["...How to fix this? - Justin_Case - 19.07.2012

Код:
C:\Users\Owner\Desktop\NERP\gamemodes\larp.pwn(3708) : warning 215: expression has no effect
C:\Users\Owner\Desktop\NERP\gamemodes\larp.pwn(3708) : error 001: expected token: ";", but found "["
C:\Users\Owner\Desktop\NERP\gamemodes\larp.pwn(3708) : error 029: invalid expression, assumed zero
C:\Users\Owner\Desktop\NERP\gamemodes\larp.pwn(3708) : warning 215: expression has no effect
C:\Users\Owner\Desktop\NERP\gamemodes\larp.pwn(3708) : error 001: expected token: ";", but found "]"
C:\Users\Owner\Desktop\NERP\gamemodes\larp.pwn(3708) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
stock GivePlayerValidWeapon( playerid, WeaponID, Ammo )
{
    //if((PlayerInfo[playerid][pConnectSeconds] < 500 || PlayerInfo[playerid][pGunLic] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
	switch( WeaponID )
	{
  		case 0, 1:
		{
			PlayerInfo[playerid][pInvWeapon][ 0 ] = WeaponID;//Line 3708
			GivePlayerWeapon( playerid, WeaponID, Ammo );
		}



Re: Expected token ";", but found "["...How to fix this? - Frosty_LV - 19.07.2012

PHP код:
stock GivePlayerValidWeaponplayeridWeaponIDAmmo )
{
    
//if((PlayerInfo[playerid][pConnectSeconds] < 500 || PlayerInfo[playerid][pGunLic] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
    
switch( WeaponID )
    {
          case 
01:
        {
        
WeaponID PlayerInfo[playerid][pInvWeapon][ ];//Line 3708
        
GivePlayerWeaponplayeridWeaponIDAmmo );
        } 



Re: Expected token ";", but found "["...How to fix this? - NuLIO - 19.07.2012

try this :

PHP код:
stock GivePlayerValidWeaponplayeridWeaponIDAmmo )
{
    
//if((PlayerInfo[playerid][pConnectSeconds] < 500 || PlayerInfo[playerid][pGunLic] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
    
switch( WeaponID )
    {
          case 
01:
        {
            
PlayerInfo[playerid][pInvWeapon] = WeaponID);//Line 3708
            
GivePlayerWeaponplayeridWeaponIDAmmo );
        } 
+rep if i help u


Re: Expected token ";", but found "["...How to fix this? - sampreader - 19.07.2012

you cannot have
PlayerInfo[playerid][pInvWeapon][ 0 ]

you can only have
PlayerInfo[playerid][pInvWeapon]


Re: Expected token ";", but found "["...How to fix this? - Justin_Case - 19.07.2012

Quote:
Originally Posted by sampreader
Посмотреть сообщение
you cannot have
PlayerInfo[playerid][pInvWeapon][ 0 ]

you can only have
PlayerInfo[playerid][pInvWeapon]
Ahh you're right thanks.