SA-MP Forums Archive
Scripting help works but bugged - 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)
+--- Thread: Scripting help works but bugged (/showthread.php?tid=286652)



Scripting help works but bugged - Buzzbomb - 29.09.2011

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);

            }
        }
    }



Re: Scripting help works but bugged - Buzzbomb - 02.10.2011

Hmmm??


Re: Scripting help works but bugged - Wesley221 - 02.10.2011

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


Re: Scripting help works but bugged - Buzzbomb - 02.10.2011

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


Re: Scripting help works but bugged - Zonoya - 02.10.2011

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


Re: Scripting help works but bugged - Buzzbomb - 02.10.2011

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