29.05.2012, 21:14
Here is my /veh command:
Basically, I want to add every single Admin spawned car to an Array (Max 100) and would give them a certain license plate like "((Admn))", I want this so that ALL admin cars can be deleted with a command. Im not sure how to do this, can anyone help please?
pawn Код:
command(veh, playerid, params[])
{
if(PVar[playerid][alevel] > 1)
{
new sCar, str[128];
new VehicleID;
new Float:X, Float:Y, Float:Z, Float:Ang;
new Int, colour1, colour2, defaultcolour;
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x66666666, "You need to be on foot to spawn a vehicle.");
if(unformat(params, "k<vehicles>D(44)D(defaultcolour)", sCar, colour1, colour2)) return SendClientMessage(playerid, 0x66666666, "Usage: /veh(icle) [Vehicle ID / Name] [Colour 1(Optional)] [Colour 2(Optional)]");
if(sCar == -1) return SendClientMessage(playerid, 0x66666666, "That vehicle model or ID doesn't exist.");
if(colour2 == defaultcolour) colour2 = colour1;
GetPlayerPos(playerid,X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
Int = GetPlayerInterior(playerid);
VehicleID = CreateVehicle(sCar, X, Y, Z, Ang, colour1, colour2, -1);
SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, VehicleID, 0);
LinkVehicleToInterior(VehicleID, Int);
format(str, sizeof(str), "You have spawned a: %s [ID %d]", VehicleNames[sCar - 400], sCar);
SendClientMessage(playerid, 0x66CCFFFF, str);
}
else
{
SendClientMessage(playerid, 0x66666666, "You are not authorised to use that command");
return 1;
}
return 1;
}