- 0
Iter_Remove
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
TheGodfather
Salut, am o comanda de /spawncar si una de /despawncars, cand spawnez 2 masini de exemplu, o despawneaza pe prima dar pe a doua nu cand dau /despawncars iar in loguri am eroarea asta:
[19:24:22] [debug]
[19:24:22] [debug] Parameter count corrections:
[19:24:22] [debug]
[19:24:22] [debug] The 1st mangled argments (e.g. `<1073741823 arguments>`) below should read `<2 arguments>`
[19:24:22] [debug]
[19:24:22] [debug] Run time error 4: "Array index out of bounds"
[19:24:22] [debug] AMX backtrace:
[19:24:22] [debug] #0 0038d318 in ?? (0, 23972552, 0) from B-HOOD.amx
[19:24:22] [debug] #1 000552f4 in ?? (0, 23972504, 0) from B-HOOD.amx
[19:24:22] [debug] #2 00057e4c in ?? (0, 23972504, 0, 0, 0, 0, 8, 0, 23972504, 0, ... <1073741813 arguments>) from B-HOOD.amx
[19:24:22] [debug] #3 00022180 in public OnPlayerCommandText (0, 23972504) from B-HOOD.amx
YCMD:spawncar(playerid, params[], help) {
if(PlayerInfo[playerid][pAdmin] < 1) return SCMM(playerid, -1, AdminOnly);
new model, color1, color2;
if(sscanf(params, "iii", model, color1, color2)) return SCMM(playerid,COLOR_GREY, "Syntax: {FFFFFF}/spawncar <Model> <color1> <color2>");
if(model < 400 || model > 611) return SCMM(playerid,-1, "Invalid car ID.");
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicleEx(model, X,Y,Z, 0.0, color1, color2, -1, 0);
Gas[carid] = 100;
SetVehicleNumberPlate(carid, "AdmCar");
Iter_Add(SpawnedCars, carid);
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicleEx(playerid, carid, 0);
new idcar = GetPlayerVehicleID(playerid), vehicle = GetVehicleModel(idcar) - 400;
SCMf(playerid, COLOR_LIGHTGOLD, "[/spawncar] {FFFFFF}You have spawned one %s, car model: %d and car ID: %d.", aVehicleNames[vehicle], model, carid);
return true;
}
YCMD:despawncars(playerid, params[], help) {
if(PlayerInfo[playerid][pAdmin] < 1) return SCMM(playerid, -1, AdminOnly);
foreach(new i : SpawnedCars)
Iter_Remove(SpawnedCars, i), DestroyVehicle(i), SCMf(playerid, -1, "%d", i);
new string[100];
format(string, sizeof(string), "[/despawncars] {FFFFFF}Admin %s destroyed all spawned cars.", GetName(playerid));
if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LIGHTGOLD, string, 1);
return true;
}
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.