CMD:dm(playerid, params[])
{
if(isinarena[playerid] == 1) return 1;
new id,str1[2];
if(sscanf(params, "I", id)) return SendClientMessage(playerid, 0xFF000000, "/dm [ID]");
valstr(str1, id);
if(str1[1] == '\0' || str1[0] == '\0')
{
new str11[750],string[200];
for(new i=0;i<3;i++)
{
format(string, sizeof(string), "%d\t%s\t%d\t%d\n",MapArenas[i][MapID],MapArenas[i][MapName],mapplayers[i],MapArenas[i][MapCapacity]);
strcat(str11, string);
}
format(string, sizeof(string), "Map ID\tMap Name\tMap Players\tMap Capacity\n%s", str11);
ShowPlayerDialog(playerid, DIALOG_AMAPS, DIALOG_STYLE_TABLIST_HEADERS, "Deathmatch Maps",
string, "Enter", "Cancel");
}
else
{
isinarena[playerid] = 1;
//new rand = random(10);
//if(rand == 1)
//{
SetPlayerPos(playerid, MapArenas[id][MapPosition][0], MapArenas[id][MapPosition][1], MapArenas[id][MapPosition][2]);
SetPlayerFacingAngle(playerid, MapArenas[id][MapPosition][3]);
SetPlayerVirtualWorld(playerid, ARENA_VW);
SetPlayerInterior(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][0], 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][1], 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][2], 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][3], 100);
new string[70];
format(string, sizeof(string), "You have joined the %s deathmatch room", MapArenas[id][MapName]);
SendClientMessage(playerid, 0x00FF00FF, string);
mapplayers[id]++;
//}
}
return 1;
}
CMD:lobby(playerid)
{
if(shottimerleft[playerid] > 0)
{
SendClientMessage(playerid, 0xFF0000FF, "You have taken damage and have to wait the 10 seconds before exiting the area.");
}
else
{
SetPlayerPos(playerid, SPAWN_X, SPAWN_Y, SPAWN_Z);
SetPlayerInterior(playerid, SPAWN_INT);
SetPlayerVirtualWorld(playerid, SPAWN_VW);
SetPlayerHealth(playerid, 999999);
SetPlayerArmour(playerid, 999999);
ResetPlayerWeapons(playerid);
isinarena[playerid] = 0;
killspree[playerid] = 0;
}
return 1;
}
Seems like something in your code is breaking OnPlayerUpdate. Are you returning 0 at OnPlayerUpdate at any part?
|
public OnPlayerUpdate(playerid) { return 1; }
[debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 53 past array upper bound 2 [debug] AMX backtrace: [debug] #0 0000ad88 in ?? () from deathmatch.amx [debug] #1 00000036 in public cmd_dm () from deathmatch.amx [debug] #2 native CallLocalFunction () [004747d0] from samp-server.exe [debug] #3 000003e0 in public OnPlayerCommandText () from deathmatch.amx |
for(new i=0;i<3;i++)
for(new i=0;i<sizeof(MapArenas);i++)