error -.-
#1

ammm i wanna do something like this : when someone join to COP , SHERIFF OR FBI TEAM and they spawn there should something happen

here is the code:

Код:
public OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_FBI || (gTeam[playerid] == TEAM_SHERIFF || (gTeam[playerid] == TEAM_COP))
  {       ----------------------------------------------> THE ERROR LINE
  SetPlayerInterior(playerid,0);
  SetPlayerCameraPos(playerid,2290.5300,2400.1262,18.4163);
  SetPlayerCameraLookAt(playerid, 2290.1648,2429.6484,10.8203);
  }
  return 1;
}
so when they spawn with these teams should happens this what is under playerspawn

but here is error:

Код:
C:\Documents and Settings\samp\Desktop\Server\gamemodes\WeedsCNR.pwn(289) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
hope you udnerstand me what i want
Reply
#2

You have more opening brackets than closing (I mean those smooth ones around this text )
Reply
#3

Quote:
Originally Posted by [NT
mamoru ]
You have more opening brackets than closing (I mean those smooth ones around this text )
amm ? can you help than where i have them i dotn see them i have 2 for open and 2 closing ...
Reply
#4

pawn Код:
public OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_SHERIFF || gTeam[playerid] == TEAM_COP)
  {       ----------------------------------------------> THE ERROR LINE
    SetPlayerInterior(playerid,0);
    SetPlayerCameraPos(playerid,2290.5300,2400.1262,18.4163);
    SetPlayerCameraLookAt(playerid, 2290.1648,2429.6484,10.8203);
  }
  return 1;
}
Reply
#5

ty
Reply
#6

Quote:
Originally Posted by Lajko1
Quote:
Originally Posted by [NT
mamoru ]
You have more opening brackets than closing (I mean those smooth ones around this text )
amm ? can you help than where i have them i dotn see them i have 2 for open and 2 closing ...
I know that ilikepie2221 has solved it for you but just to point it out:
if(gTeam[playerid] == TEAM_FBI || (gTeam[playerid] == TEAM_SHERIFF || (gTeam[playerid] == TEAM_COP))
1 2 3 32

you are missing the closing '1' or, as ilikepie (what a name) has done: omitting the '2' and '3'
Reply
#7

Erhm what the jacksh**?

pawn Код:
if(gTeam[playerid] == TEAM_FBI || (gTeam[playerid] == TEAM_SHERIFF || (gTeam[playerid] == TEAM_COP))
That will not compile.

This is how it is done:

pawn Код:
if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_SHERIFF || gTeam[playerid] == TEAM_COP)
Will compile fine.

There is no need to open another parenthese if you use the LOGICAL OR operator( '||').
Reply
#8

ty ty
Reply
#9

Quote:
Originally Posted by [NT
Extremo ]
Erhm what the jacksh**?

pawn Код:
if(gTeam[playerid] == TEAM_FBI || (gTeam[playerid] == TEAM_SHERIFF || (gTeam[playerid] == TEAM_COP))
That will not compile.

This is how it is done:

pawn Код:
if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_SHERIFF || gTeam[playerid] == TEAM_COP)
Will compile fine.

There is no need to open another parenthese if you use the LOGICAL OR operator( '||').
guess my explaination was a bit off huh? Don't blame me, blame the poster.... wait.. that is me, blame time! It was about 1 AM

and I finally saw what the name of ilikepie stood for I_like_pie.. I read it as one word so I was like 'wtf?'.... I think I'd better to go bed now..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)