SA-MP Forums Archive
State Change and Leave Vehicle - 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: State Change and Leave Vehicle (/showthread.php?tid=350708)



State Change and Leave Vehicle - lordturhan - 13.06.2012

pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid == 476)
        {
            SendClientMessage(playerid, 0xFF0000AA, "You entered in a Bomber plane press Space to drop the bomb.");
            SendClientMessage(playerid, RED, "Warning: It is powerful so becarful while using it.");
            return 1;
        }
    }
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if (vehicleid == 476)
    {
      Clicked[playerid] = 0;
      Allowed[playerid] = 0;
      KillTimer(Timer[playerid]);
      SendClientMessage(playerid,-1,"Test Message");
    }
    return 1;
}
I'm currently working on a Rustler script (Scripted by Faisal_khan) but he got some stuff wrong so i decided to change them on my ways.

But the fact is this shits not working.And OnPlayerExitVehicle is important for me.


Re: State Change and Leave Vehicle - tiernantheman - 13.06.2012

What exactly is the problem?


Re: State Change and Leave Vehicle - JhnzRep - 13.06.2012

pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(GetPlayerVehicleModelID(vehicleid) == 476)
        {
            SendClientMessage(playerid, 0xFF0000AA, "You entered in a Bomber plane press Space to drop the bomb.");
            SendClientMessage(playerid, RED, "Warning: It is powerful so becarful while using it.");
            return 1;
        }
    }
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
     if(GetPlayerVehicleModelID(vehicleid) == 476)
    {
      Clicked[playerid] = 0;
      Allowed[playerid] = 0;
      KillTimer(Timer[playerid]);
      SendClientMessage(playerid,-1,"Test Message");
    }
    return 1;
}
GetPlayerVehicleID, doesn't get what type of vehicle it is, but the virtual ID of the vehicle.


Re: State Change and Leave Vehicle - lordturhan - 13.06.2012

Quote:
Originally Posted by tiernantheman
Посмотреть сообщение
What exactly is the problem?
Simple, messages not sending.

And above user ^^ not working.