Kill nearby vehicle
#1

Is there any admin command to kill nearby vehicles one by one? for example (/kcc - /killclosestcar) By using this command as an admin you kill the nearest vehicle to you. And then it gets respawned at its spawn point.

I appreciate all the help!

Thanks.
Reply
#2

Well try this and check if it works:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/kcc", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin[playerid])
        {
            new Float:X, Float:Y, Float:Z, Float:X1, Float:Y1, Float:Z1;
            GetPlayerPos(playerid, X, Y, Z);
            for(new i = 0; i < MAX_VEHICLES; i++)
            {
                new vid = GetPlayerVehicleID(playerid);
                if(GetVehicleDistanceFromPoint(i, X1, Y1, Z1) == 20)//here 20 is the radius
                {
                    DestroyVehicle(i);
                }
            }
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)