State Change and Leave Vehicle
#1

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.
Reply
#2

What exactly is the problem?
Reply
#3

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.
Reply
#4

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

And above user ^^ not working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)