Why these error
#1

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
Reply
#2

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
Reply
#3

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
Reply
#4

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
Reply
#5

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

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");
  }
  }
Reply
#7

show me ur line 816
Reply
#8

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.
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)