Vehicle must not respawn
#5

pawn Код:
// Top of Script with Global variables.
static
    veh[MAX_PLAYERS]; // Asigns the Created vehicle to that player.
pawn Код:
if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, COLOR_RED," SERVER : You don't have so much money!");
GetPlayerPos(playerid, X,Y,Z);
veh[playerid] = CreateVehicle(499, X,Y,Z, Angle, 44, 44, -1); // This avoids the last CreatedVehicle from being destroyed, it now destroys one assigned to that player.
SetPVarInt(playerid, #CreatedCar, 1);// Player has created a vehicle.
PutPlayerInVehicle(playerid,veh,0);
GivePlayerMoney(playerid,-4500);
SendClientMessage(playerid,COLOR_ROYALBLUE,"CAR SHOP : You have bought a Benson Cost: "COL_WHITE" $4,500");
pawn Код:
public OnVehicleDeath(vehicleid, killerid) // KillerID = Player that caused the vehicle to destroy.
{
    if(GetPVarInt(killerid, #CreatedCar) == 1) // Checks if they created a vehicle.
    {
        DestroyVehicle(veh[playerid]);
        DeletePVar(playerid, #CreatedCar); // No longer have a created car assigned to them.
    }
    return 1;
}
Reply


Messages In This Thread
Vehicle must not respawn - by vassilis - 28.01.2015, 02:40
Re: Vehicle must not respawn - by Columbian - 28.01.2015, 03:27
Re: Vehicle must not respawn - by Arxalan - 28.01.2015, 03:48
Re: Vehicle must not respawn - by andrewgrob - 28.01.2015, 03:58
Re: Vehicle must not respawn - by Lynn - 28.01.2015, 04:45
Re: Vehicle must not respawn - by vassilis - 29.01.2015, 03:05

Forum Jump:


Users browsing this thread: 1 Guest(s)