20.06.2009, 10:21
Ok two things i can't figure out.
1) No matter if i use Addstaticvehicle or CreateVehicle when i destroyvehicle they don't respwan.
2) How do i destroy the trailer the truck is towing after some advice i have created array and gone Trailler[1] = AddStatiVehicle e.t.c but when i enter checkpoint (see code below) i need to figure out which trailer i am towing, i don't want to have to destroy them all.
Thanks in advance,
Josh
1) No matter if i use Addstaticvehicle or CreateVehicle when i destroyvehicle they don't respwan.
2) How do i destroy the trailer the truck is towing after some advice i have created array and gone Trailler[1] = AddStatiVehicle e.t.c but when i enter checkpoint (see code below) i need to figure out which trailer i am towing, i don't want to have to destroy them all.
Код:
public OnPlayerEnterCheckpoint(playerid) {
new vehicleid=GetPlayerVehicleID( playerid );
if (IsPlayerInVehicle(playerid,vehicleid) ) {
if ( IsTrailerAttachedToVehicle(vehicleid) )
{
GameTextForPlayer(playerid, "~r~Congratulations! Here, have 5k", 2000, 3);
GivePlayerMoney(playerid, 5000);
DisablePlayerCheckpoint(playerid);
RemovePlayerFromVehicle(playerid);
DestroyVehicle(vehicleid);
DestroyVehicle(Trailer[0]);
}
else {
GameTextForPlayer(playerid, "~r~You need a trailer. Noob", 2000, 3);
}}
else { DisablePlayerCheckpoint(playerid);
}
return 1;
}
Josh


