13.09.2011, 15:19
I found this bit of code:
So I decided to make a /destroyv command. Here it is:
But vehicleid is undefined... How to define it?
pawn Код:
stock IsPlayerInRangeOfVehicle(playerid, vehicleid, Float:Range)
{
new Float:Pos[3];
GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]);
return IsPlayerInRangeOfPoint(playerid, Range, Pos[0], Pos[1], Pos[2]);
}
pawn Код:
dcmd_destroyv(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][Admin] >= 2)
{
if(IsPlayerInRangeOfVehicle(playerid,vehicleid,10))
{
DestroyVehicle(vehicleid);
new name[24];
new string[128];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Server: %s (id:%d) has deleted all vehicles around them",name,playerid);
return SendClientMessage(playerid,orange,string);
}
}
return 1;
}