Spawn - reSpawn vehicles - need help -
FL3GM4 - 25.12.2012
i make cars with:
Код:
CMD:ecar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new
mID,
cl1,
cl2,
vID,
Float:x, Float:y, Float:z, Float:ang;
if(sscanf(params, "iii", mID, cl1, cl2)) return SendClientMessage(playerid, 0xAADD00AA, "{FFFFFF}Koristi:{AADD00} /ecar <ID modela vozila> <boja 1> <boja 2>");
else
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
vID = CreateVehicle(mID, x + 3.0, y + 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x + 3.0, y - 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x - 3.0, y + 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x - 3.0, y - 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x - 9.0, y + 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x - 9.0, y - 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x + 9.0, y + 2, z, ang, cl1, cl2, 86400);
vID = CreateVehicle(mID, x + 9.0, y - 2, z, ang, cl1, cl2, 86400);
}
}
else SendClientMessage(playerid, 0xFF0000AA, "Ne mozes koristiti tu komandu.");
return 1;
}
Код:
CMD:rac(playerid,params[])
{
new id, string[128], ReturnName[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, "Samo admini");
for(new car = 1; car <= 268; car++)
{
if(IsVehicleEmpty(car)) DestroyVehicle(car);
}
GetPlayerName(id, ReturnName, sizeof(ReturnName));
format(string, sizeof(string), "WS:DM: Sva ne koristena vozila su respawnana od admina %s.", PlayerName(playerid));
SendAdminMessage(1,COLOR_GREY,string);
return 1;
}
how to make that /rac command destroy cars maked with /ecar command, and respawn all other cars on server
Re: Spawn - reSpawn vehicles - need help -
Larceny - 25.12.2012
pawn Код:
new bool:gnCreatedCars[MAX_VEHICLES];//
CMD:ecar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new
mID,
cl1,
cl2,
vID,
Float:x, Float:y, Float:z, Float:ang;
if(sscanf(params, "iii", mID, cl1, cl2)) return SendClientMessage(playerid, 0xAADD00AA, "{FFFFFF}Koristi:{AADD00} /ecar <ID modela vozila> <boja 1> <boja 2>");
else
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
vID = CreateVehicle(mID, x + 3.0, y + 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x + 3.0, y - 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x - 3.0, y + 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x - 3.0, y - 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x - 9.0, y + 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x - 9.0, y - 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x + 9.0, y + 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
vID = CreateVehicle(mID, x + 9.0, y - 2, z, ang, cl1, cl2, 86400);
gnCreatedCars[vID] = true;//
}
}
else SendClientMessage(playerid, 0xFF0000AA, "Ne mozes koristiti tu komandu.");
return 1;
}
CMD:rac(playerid,params[])
{
new id, string[128], ReturnName[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, "Samo admini");
for(new car = 1; car <= 268; car++)
{
if(IsVehicleEmpty(car)) SetVehicleToRespawn(car);
if(gnCreatedCars[car]){ DestroyVehicle(car); gnCreatedCars[car] = false; }//
}
GetPlayerName(id, ReturnName, sizeof(ReturnName));
format(string, sizeof(string), "WS:DM: Sva ne koristena vozila su respawnana od admina %s.", PlayerName(playerid));
SendAdminMessage(1,COLOR_GREY,string);
return 1;
}