Help with this
#1

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


Whats wrong?
Reply
#2

Remove the ; from the end.
Reply
#3

Brings alot more errors,
Reply
#4

Show the code near it.
Reply
#5

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

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

Errors still there
Reply
#8

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 ( ; )
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)