SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error -.- (/showthread.php?tid=101841)



error -.- - Lajko1 - 12.10.2009

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


Re: error -.- - mamorunl - 12.10.2009

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


Re: error -.- - Lajko1 - 12.10.2009

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


Re: error -.- - ilikepie2221 - 12.10.2009

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;
}



Re: error -.- - Lajko1 - 12.10.2009

ty


Re: error -.- - mamorunl - 13.10.2009

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'


Re: error -.- - Extremo - 13.10.2009

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( '||').


Re: error -.- - Lajko1 - 13.10.2009

ty ty


Re: error -.- - mamorunl - 14.10.2009

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