checking if its the delorean vehicle not working
#1

hey everyone,

i am trying to make something like BTTF, but now when i enter the Delorean car, it doesnt checks if it is, it doesnt even sends the messages..

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == Delorean) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, COLOR_RED, "only the driver may use this vehicle, no passengers allowed");
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == Delorean)
        {
            if(PlayerInfo[playerid][HasPlutonium] == 2)
            {
                SendClientMessage(playerid, COLOR_WHITE, "as soon as this Delorean hits 88 mph/140 kmh it will send you to the past");
            }
            else if(PlayerInfo[playerid][HasPlutonium] == 0)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "you cannot use this vehicle without Plutonium");
            }
        }
    }
    if(oldstate == PLAYER_STATE_DRIVER)
    {
        //
    }
    return 1;
}
wuts wrong with this?
Reply
#2

There's something wrong with the vehicleid you are checking. Try to use an actual vehicleid (example:423) and see if it works (it is, I have tested). The problem is occurred coz of your Delorean variable.
Reply
#3

my deloream variable is defined as a createvehicle in ongamemodeinit, and i only want it to work on that single car, not all of the same cars, for example if i have the jester which is the delorean somewhere spawned, and someone goes in it, then it works, but if someone goes in another jester, which is spawned somewhere else and isnt the delorean, then it shouldnt work...

so how to check for this? only the 1 single delorean(jester) works, and all the other jesters dont work, only this one, is this possible?
Reply
#4

Just remove GetVehicleModel and you should be done, as you only want to check for a vehicleid
Reply
#5

thnx, i will try it tomoroww, am on mah mobile now and am tired
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)