Two teams, How to do this
#1

I have two teams on my server,
One cops, And one crooks,
I want to make it so if you get in a copcar,
And your a cop, It runs the engine system,
But if im a crook, It asks me to hotwire the vehicle,
Ive done it right, But it says Hotwire and engine start,
How to get it to just say Hotwire

My code:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsACopCar(vehicleid))
    {
    if(GetPlayerTeam(playerid) == TEAM_COPLS)
    {
    SendClientMessage(playerid, GREEN, "You are in a cop car");
    }
    else
    {
    SendClientMessage(playerid, RED, "To hotwire this vehicle Press (Right Mouse Button)");
    }
    }
}
  if(newstate == PLAYER_STATE_DRIVER)
        {
          new vehicleid = GetPlayerVehicleID(playerid);
            if(Engine[vehicleid] == 0)
            {
            TogglePlayerControllable(playerid, 0);
            SendClientMessage(playerid, YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
            }
            else if(Engine[vehicleid] == 1)
            {
            SendClientMessage(playerid, GREEN, "Engine Running...");
            }
            else if(GetPlayerTeam(playerid == 2))
            {
            if(IsACopCar(vehicleid))
            {
            SendClientMessage(playerid, YELLOW, "Vehicle Name: Police Car LS");
        }
    }
}
    return 1;
}
Reply
#2

You have put the gTeam check for cops after the message, this will cause It to first send the message, then check for team.

Move it up.
Reply
#3

GetPlayerTeam is better, But thats what im doing, It shows both though, I want it to show one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)