25.12.2012, 12:08
i make cars with:
how to make that /rac command destroy cars maked with /ecar command, and respawn all other cars on server
Код:
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; }