OnPlayerStateChange
#1

Hello i want if player get in ambulance he gets message type /paramdic to start the job this code dosent work it sends nothing to me

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
       
         if(GetVehicleModel(GetPlayerVehicleID(playerid) == 416)
         {
            SendClientMessage(playerid,Red,"Type /paramidc to start job");  
         }
    }
    return 1;
}
Reply
#2

You should rather use OnPlayerEnterVehicle callback for this, since you're relating this completely to vehicles.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 416)
    {
        SendClientMessage(playerid,Red,"Type /paramidc to start job");
    }
    return 1;
}
Reply
#3

Just try

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
         if(GetVehicleModel(GetPlayerVehicleID(playerid) == 416)
         {
            SendClientMessage(playerid,Red,"Type /paramidc to start job");  
         }
    }
    return 1;
}
EDIT; someone posted before, nvm...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)