Scripting help works but bugged
#1

All Vehicles are Locked out Its crazy I have the vehicles i want under gamemodeinit As
FiremanVehicle = AddStaticVehicle(407,833.9660,-2397.6414,13.3359,297.7759,3,3); // Firetruck
PoliceVehicle = AddStaticVehicle(596,1536.5144,-1668.5848,13.1911,22.6003,106,106); // lspd

But some reason every car on my gamemode is Police and fireman vehicles... its weird....
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
//===============================FireMan Vehicles===============================
    new PrivateVehicles[24];
    GetPlayerName(playerid, PrivateVehicles, sizeof(PrivateVehicles));
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        if(Vehicle == FiremanVehicle == PlayerInfo[playerid][pJob] >= 1)
        {
            if(strcmp(PrivateVehicles,"FiremanVehicle",true))
            {
                SendClientMessage(playerid, 0x33AA33AA, "You Are Not On Fire Duty");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
//==============================Police Vehicles=================================
    GetPlayerName(playerid, PrivateVehicles, sizeof(PrivateVehicles));

    if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
        if(Vehicle == PoliceVehicle == PlayerInfo[playerid][pJob] >= 2)
        {
            if(strcmp(PrivateVehicles,"PoliceVehicle",true))
            {
                 SendClientMessage(playerid, 0x33AA33AA, "You Are not On Police Duty");
                 RemovePlayerFromVehicle(playerid);

            }
        }
    }
Reply
#2

Hmmm??
Reply
#3

pawn Код:
if( Vehicle == PoliceVehicle && PlayerInfo[playerid][pJob] >= 2 )
if( Vehicle == FiremanVehicle && PlayerInfo[playerid][pJob] >= 1 )
That will do it i guess?
Reply
#4

Hmm unlocked all the cars but didnt remove me from the police of fireman.. vehicles
Reply
#5

ok here is the answer
pawn Код:
RemovePlayerFromVehicle(playerid, FiremanVehicle);
and
pawn Код:
RemovePlayerFromVehicle(playerid, PoliceVehicle);
u missed the car Name from RemovePlayerFromVehicle
Reply
#6

I know what i should of done was use teams i bet that would of worked better.. but im try your way zonoya
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)