OnVehicleDeath Problem
#1

Hey guys when a players owned vehicles is destoryed it should send a message to the owners if he or she is online and playing.

Note: new ownerid = GetPlayerIDFromName(AddUnderScoreToName(VehicleInf o[slot][vOwnerName])); - is working correctly a returns a slot id and the correct slot, so no questions asking if it is working or not.


pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    new slot = GetVehicleSlotFromID(vehicleid);
    if(slot > -1)
    {
        new ownerid = GetPlayerIDFromName(AddUnderScoreToName(VehicleInfo[slot][vOwnerName]));
        if(ownerid > -1)
        {
            if(IsPlayerConnected(ownerid))
            {
                if(VehicleInfo[slot][vInsurance] > 0)
                {
                    VehicleInfo[slot][vInsurance] --;
                    VehicleInfo[slot][vDestroyed] ++;
                    VehicleInfo[slot][vImpounded] = 1;

                } else {
                    SendClientMessage(ownerid, 0xFFFFFFFF, "[{33CCFF}INFO{FFFFFF}]: I'm sorry to inform you that you don't have any insurace to cover your vehicles destoruction, and it has been impounded until you can retrive it.");
                }
            }
        }
    }
    return true;
}
Reply


Messages In This Thread
OnVehicleDeath Problem - by zT KiNgKoNg - 27.12.2013, 18:45
Re: OnVehicleDeath Problem - by Cypress - 27.12.2013, 19:37
Re: OnVehicleDeath Problem - by zT KiNgKoNg - 27.12.2013, 20:19
Re: OnVehicleDeath Problem - by Cypress - 27.12.2013, 21:40
Re: OnVehicleDeath Problem - by zT KiNgKoNg - 28.12.2013, 09:29

Forum Jump:


Users browsing this thread: 2 Guest(s)