03.04.2019, 16:32
commands were working find until i complied with ysi v4 now they just send SERVER:Unknown command msg and creates the object,
the console:
the console:
Code:
[18:18:49] [debug] Run time error 4: "Array index out of bounds" [18:18:49] [debug] Attempted to read/write array element at index 1032 in array of size 996 [18:18:49] [debug] AMX backtrace: [18:18:49] [debug] #0 0001de20 in public cmd_ocreate (2, 347436) in AdminSys.amx [18:18:49] [debug] #1 native CallLocalFunction () in sampsvr-port_177 [18:18:49] [debug] #2 000006d8 in public OnPlayerCommandText (2, 347380) in AdminSys.amx
Code:
CMD:ocreate(playerid, params[]) { if(PlayerInfo[playerid][Level]<3) return SendClientMessage(playerid, COLOR_RED, "SERVER: You're not allowed to use this command"); new objectid; if(sscanf(params,"d", objectid)) return SendClientMessage(playerid,COLOR_RED,"Usage:/ocreate [object id]"); if(objectid < 321 || objectid > 19999) return SendClientMessage(playerid,COLOR_RED,"SERVER: Object ID not found."); { objects++; objectsid[objects]=objectid; new Float:X, Float:Y, Float:Z, str[128]; GetPlayerPos(playerid, X, Y, Z); SpawnedObject[objects] = CreateDynamicObject(objectid, X, Y, Z+1, 0, 0, 0); ObjectSpawned[SpawnedObject[objects]] = 1; format(str, 128, "SERVER: Object ID: %d - Created at your location - Index: %d", objectid, objects); SendClientMessage(playerid, COLOR_RED, str); } return 1; }