27.07.2012, 10:36
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
//This will be called always when player changes state from driver to other
if(oldstate == PLAYER_STATE_DRIVER)
{
if(IsDeliveryVeh(PlayerInfo[playerid][pDeliveryVeh])) //There is no vehicleid
{
new Float:Health;
GetVehicleHealth(GetPlayerVehicleID(playerid), Health);
for(new i = 0; i < 12; i++) TogglePlayerDynamicCP(playerid, DeliveryJobCP[i],0);
DisablePlayerCheckpoint(playerid);
if(Health < 250)
{
PlayerInfo[playerid][pDeliveryVeh] = -1;
DeliverWHpay[playerid] = 0;
DeliverCounter[playerid] = 0;
StartingDeliveryJob[playerid] = 0;
LastDeliveryCP[playerid] = 0;
DeliveryMission[playerid] = 0;
return SendClientMessage(playerid, COLOR_ORANGE, "Your vehicle is badly damaged. You lost your wage!");
}
else return SendClientMessage(playerid, COLOR_ORANGE, "Don't lose your vehicle or you will lose your wage!");
}
}
}