22.11.2017, 07:43
Hi!
I have this error in server_log
Command:
I say in chat: /henter 300
I have this error in server_log
Quote:
[16:44:38] [debug] Run time error 4: "Array index out of bounds" [16:44:38] [debug] Attempted to read/write array element at index 300 in array of size 120 [16:44:38] [debug] AMX backtrace: [16:44:38] [debug] #0 002b17e4 in public pc_cmd_henter (playerid=2, params[]=@002be7b4 "300") at grandlarc.pwn:36899 |
Quote:
CMD:henter(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < return SendClientMessage(playerid, COLOR_WHITE, "{5CAD5C}Error: Your admin/helper level isn't high enough to use this command."); new id; if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "INFO: /henter [id]"); new Float:X, Float:Y, Float:Z, Float:A, string[200]; GetPlayerPos(playerid, X, Y, Z); HouseInfo[id][hEntx] = X; HouseInfo[id][hEnty] = Y; HouseInfo[id][hEntz] = Z; GetPlayerFacingAngle(playerid, A); HouseInfo[id][hEntrancea] = A; DestroyDynamic3DTextLabel(HouseLabel[id]); if(HouseInfo[id][hOwned]) { if(!HouseInfo[id][hRent]) { format(string, sizeof(string), "{006400}House %d \n{006400}This House is owned by {FFFFFF}%s \n{006400}Level: {FFFFFF}%d", id, HouseInfo[id][hOwner], HouseInfo[id][hLevel]); } else { format(string, sizeof(string), "{006400}House %d \n{006400}This House is owned by {FFFFFF}%s \n{006400}Rent: {FFFFFF}%d$ \n{006400}Level: {FFFFFF}%d \n{006400}Type /rentroom to rent a room", id, HouseInfo[id][hOwner], HouseInfo[id][hRent], HouseInfo[id][hLevel]); } HouseLabel[id] = CreateDynamic3DTextLabel(string, 0x006400FF, HouseInfo[id][hEntx], HouseInfo[id][hEnty], HouseInfo[id][hEntz], 15.0); } else { format(string, sizeof(string), "{006400}House %d \nThis House is for sale \n{006400}Cost: {FFFFFF}%d$ \n{006400}Level: {FFFFFF}%d \n{006400}To buy this house type /buyhouse", id, HouseInfo[id][hValue], HouseInfo[id][hLevel]); HouseLabel[id] = CreateDynamic3DTextLabel(string, 0x006400FF, HouseInfo[id][hEntx], HouseInfo[id][hEnty], HouseInfo[id][hEntz], 15.0); } if(IsValidDynamicMapIcon(HouseInfo[id][hPickup])) DestroyDynamicMapIcon(HouseInfo[id][hPickup]); HouseInfo[id][hPickup] = CreateDynamicMapIcon(X, Y, Z, 31, COLOR_GREEN); format(string,sizeof(string), "You have set House: %d's Entrance", id); SendClientMessage(playerid, COLOR_ADMIN, string); format(string, sizeof(string), "%s (%d) House Enter %d %s %s", PlayerInfo[playerid][pName], playerid, id, GetDMY(1), GetHMS()); AdminLog(string); return 1; } |