Need a funktion
#2

Somewhere, outside any other function:
pawn Код:
stock ExplodeVehicle(vehicleid)
{
    new Float:X,Float:Y,Float:Z;
    GetVehiclePos(vehicleid, X, Y, Z);
    CreateExplosion(X, Y, Z, 7, 5);
    SetVehicleHealth(vehicleid, 0);
}
And when you want to explode a vehicle, put "ExplodeVehicle(vehicleid)" in the event.

EDIT: I've now understood:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(PlayerToPoint(playerid, X, Y, Z) < RADIUS) // Or IsPlayerInRangeOfPoint(playerid, RADIUS, X, Y, Z)
    {
        ExplodeVehicle(GetPlayerVehicleID(playerid));
    }
    return 1;
}
Reply


Messages In This Thread
Need a funktion - by cruising - 16.06.2011, 11:33
Re: Need a funktion - by Sasino97 - 16.06.2011, 12:21
Re: Need a funktion - by Lorenc_ - 16.06.2011, 12:23
Re: Need a funktion - by Sasino97 - 16.06.2011, 12:27
Re: Need a funktion - by Simon - 16.06.2011, 12:46

Forum Jump:


Users browsing this thread: 1 Guest(s)