SA-MP Forums Archive
Something is wrong with this code! - 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: Something is wrong with this code! (/showthread.php?tid=127185)



Something is wrong with this code! - Lorenc_ - 12.02.2010

Hello I got errors when i insert this code..
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate = PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
  {
  	if(IsPlayerInChoppa(playerid)



	}
  return 1;
}
How Could i improve it and make it have no errors?


Re: Something is wrong with this code! - aNdReSkKkK - 12.02.2010

there is a

){

missing after if(IsPlayerInChoppa(playerid) ?


Re: Something is wrong with this code! - dice7 - 12.02.2010

pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)



Re: Something is wrong with this code! - adsy - 12.02.2010

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  {
    if(IsPlayerInChoppa(playerid){
    }

  return 1;
}
try that


Re: Something is wrong with this code! - Lorenc_ - 12.02.2010

None of them work...


Re: Something is wrong with this code! - Anwix - 12.02.2010

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  {
    if(IsPlayerInChoppa(playerid))
    {
    }
  }
  return 1;
}



Re: Something is wrong with this code! - Bayler - 12.02.2010

as andreskkk stated, your missing brackets, then like 4 people post afterward and make the same mistake

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  {
    if(IsPlayerInChoppa(playerid))
    {
     //your code here
    }
  }
  return 1;
}
Notice the if(IsPlayerInChoppa(playerid)) ALL opened Brackets are Closed!


Re: Something is wrong with this code! - Lorenc_ - 12.02.2010

Thanks so much guys i thought ill never pass!


Re: Something is wrong with this code! - adsy - 12.02.2010

Quote:
Originally Posted by Bayler
as andreskkk stated, your missing brackets, then like 4 people post afterward and make the same mistake

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  {
    if(IsPlayerInChoppa(playerid))
    {
     //your code here
    }
  }
  return 1;
}
Notice the if(IsPlayerInChoppa(playerid)) ALL opened Brackets are Closed!
DOH!

although there was more missing

newstate ==
)
{

thats the summary