SA-MP Forums Archive
Help with this - 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: Help with this (/showthread.php?tid=115299)



Help with this - JoeDaDude - 23.12.2009

pawn Код:
if(gTeam[playerid] == TEAM_COP);
Error: Empty Statement


Whats wrong?


Re: Help with this - MadeMan - 23.12.2009

Remove the ; from the end.


Re: Help with this - JoeDaDude - 23.12.2009

Brings alot more errors,


Re: Help with this - MadeMan - 23.12.2009

Show the code near it.


Re: Help with this - JoeDaDude - 23.12.2009

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
  if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
  {
    if(vehicleid == cruiser1)
    {
        if(gTeam[playerid] == TEAM_COP);
      }
      else
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_RED, "This vehicle belongs to the San Fierro Police Department.");
      }
    }
    return 1;
}



Re: Help with this - Niixie - 23.12.2009

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new vehicleid = GetPlayerVehicleID(playerid);
  if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
  {
    if(vehicleid == cruiser1)
    {
      if(!gTeam[playerid] == TEAM_COP);
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_RED, "This vehicle belongs to the San Fierro Police Department.");
      }
    }
   }
   return 1;
}
UNTESTED

How about that? donno if it would work


Re: Help with this - JoeDaDude - 23.12.2009

Errors still there


Re: Help with this - mamorunl - 23.12.2009

Quote:
Originally Posted by Niixie
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new vehicleid = GetPlayerVehicleID(playerid);
  if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
  {
    if(vehicleid == cruiser1)
    {
      if(!gTeam[playerid] == TEAM_COP);
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_RED, "This vehicle belongs to the San Fierro Police Department.");
      }
    }
  }
  return 1;
}
UNTESTED

How about that? donno if it would work
haha, you still forgot to remove the semi-colon xD ( ; )


Re: Help with this - JoeDaDude - 23.12.2009

If i remove the semi-colon,

pawn Код:
C:\Users\Torran\Documents\Server\gamemodes\script.pwn(485) : error 029: invalid expression, assumed zero
C:\Users\Torran\Documents\Server\gamemodes\script.pwn(485 -- 486) : warning 215: expression has no effect
C:\Users\Torran\Documents\Server\gamemodes\script.pwn(486) : error 001: expected token: ";", but found "else"
C:\Users\Torran\Documents\Server\gamemodes\script.pwn(492) : warning 217: loose indentation
C:\Users\Torran\Documents\Server\gamemodes\script.pwn(495) : error 030: compound statement not closed at the end of file (started at line 479)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.



Re: Help with this - Niixie - 23.12.2009

Put this in and tell me the errors

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new vehicleid = GetPlayerVehicleID(playerid);
  if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
  {
    if(vehicleid == cruiser1)
    {
      if(!gTeam[playerid] == TEAM_COP)
      {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_RED, "This vehicle belongs to the San Fierro Police Department.");
      }
    }
   }
   return 1;
}