SA-MP Forums Archive
Why these error - 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: Why these error (/showthread.php?tid=481954)



Why these error - FireWarrior101 - 18.12.2013

pawn Код:
if(pickupid == heatseekersupplydepo)//Heatseeker
  {
  if((tCP[SUPPLYDEPO] = TEAM_RANGERS && gTeam[playerid] = TEAM_RANGERS))
  {
  SendClientMessage(playerid,COLOR_GREY,"[SERVER]{FFFFFF}You Picked 5 ammo of HeatSeekers");
  GivePlayerWeapon(playerid,36,2);
  }
  }
Errors:
pawn Код:
D:\Host\gamemodes\coh.pwn(816) : error 022: must be lvalue (non-constant)
D:\Host\gamemodes\coh.pwn(816) : error 029: invalid expression, assumed zero



Re: Why these error - ReD_HunTeR - 18.12.2013

try this
Код:
if(pickupid == heatseekersupplydepo) 
 {
     if((tCP[SUPPLYDEPO] = TEAM_RANGERS && gTeam[playerid] = TEAM_RANGERS))  
       {
           SendClientMessage(playerid,COLOR_GREY,"[SERVER]{FFFFFF}You Picked 5 ammo of HeatSeekers");             GivePlayerWeapon(playerid,36,2);
        }
 }
not working still??
show me ur just 816 line


Re: Why these error - FireWarrior101 - 18.12.2013

After i applied your code
pawn Код:
if(pickupid == heatseekersupplydepo)
  {
     if((tCP[SUPPLYDEPO] = TEAM_RANGERS && gTeam[playerid] = TEAM_RANGERS))//Line 816
       {
           GivePlayerWeapon(playerid,36,2);
           SendClientMessage(playerid,COLOR_GREY,"[SERVER]{FFFFFF}You Picked  ammo of HeatSeekers");             GivePlayerWeapon(playerid,36,2);
       }
  }
i get these errors
pawn Код:
:\Host\gamemodes\coh.pwn(816) : error 022: must be lvalue (non-constant)
D:\Host\gamemodes\coh.pwn(816) : error 029: invalid expression, assumed zero



Re: Why these error - FireWarrior101 - 18.12.2013

someone please help me with this all i am trying is that if the zone is captured by the team members of that team can pick up the pickups


Re: Why these error - Champ - 18.12.2013

pawn Код:
if((tCP[SUPPLYDEPO] == TEAM_RANGERS && gTeam[playerid] == TEAM_RANGERS))//Line 816



Re: Why these error - FireWarrior101 - 18.12.2013

This didnt work
even if i am other team it picks the weapon even if area is not captured
pawn Код:
if(pickupid == heatseekersupplydepo)
  {
  if((tCP[SUPPLYDEPO] == TEAM_RANGERS && gTeam[playerid] == TEAM_RANGERS))//Line 816
  {
  GivePlayerWeapon(playerid,36,2);
  SendClientMessage(playerid,COLOR_GREY,"[SERVER]{FFFFFF}You Picked  ammo of HeatSeekers");
  }
  }



Re: Why these error - ReD_HunTeR - 18.12.2013

show me ur line 816


Re: Why these error - Riddick94 - 18.12.2013

Quote:
Originally Posted by BlackBomb
Посмотреть сообщение
show me ur line 816
Wtf?

This line (816):
pawn Код:
if((tCP[SUPPLYDEPO] == TEAM_RANGERS && gTeam[playerid] == TEAM_RANGERS))
Change to:
pawn Код:
if(tCP[SUPPLYDEPO] == TEAM_RANGERS && gTeam[playerid] == TEAM_RANGERS)
If it doesn't work, then something with your variables must be screwed up (make sure, that macro's are defined properly).

edit://
@down, check my code.


Re: Why these error - FireWarrior101 - 18.12.2013

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
Wtf?

This line (816):
pawn Код:
if((tCP[SUPPLYDEPO] == TEAM_RANGERS && gTeam[playerid] == TEAM_RANGERS))
Change to:
pawn Код:
if(tCP[SUPPLYDEPO] == TEAM_RANGERS && gTeam[playerid] == TEAM_RANGERS)
If it doesn't work, then something with your variables must be screwed up (make sure, that macro's are defined properly).
The player still gets ammmo if area is not captured by any team


Re: Why these error - Riddick94 - 18.12.2013

Quote:
Originally Posted by FireWarrior101
Посмотреть сообщение
The player still gets ammmo if area is not captured by any team
Then you have to debug your values of the variables. Make sure that you SET player to proper team for both arrays.

I mean:
However you use that array here:
pawn Код:
tCP[SUPPLYDEPO]
It MUST be set to the value of TEAM_RANGERS macro. And same here:
pawn Код:
gTeam[playerid]
That one must be set to the same value as previous array, so it's gonna be TEAM_RANGERS again, but make sure that you set player to this team before all that (e.g. OnPlayerSpawn or OnPlayerRequestClass callbacks)

Then, it must work.