saving color with Y_INI + crash detect problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: saving color with Y_INI + crash detect problem (
/showthread.php?tid=452630)
saving color with Y_INI + crash detect problem -
[D]ry[D]esert - 22.07.2013
Hello, i tried to load
Int Color using Y INI system.
And when i tried to load the color and set player's color, It set my color to black and show me
something on consol, which it is:
Код:
[05:39:17] [debug] Run time error 4: "Array index out of bounds"
[05:39:17] [debug] Accessing element at negative index -1
[05:39:17] [debug] AMX backtrace:
[05:39:17] [debug] #0 00045e88 in public SetPlayerClanColor (0x0000000f) from xd.amx
And here is my code:
pawn Код:
#define MAX_CLANS 5
enum clanss
{
cName[50],
cTag[50],
cColor[10],
cExist,
cMembers,
}
new Clans[MAX_CLANS][clanss];
public SetPlayerClanColor(playerid)
{
if(GetPlayerColor(playerid) == COLOR_GREEN)
{
new color,clan = GetPlayerClan(playerid);
color = Clans[clan][cColor];
SetPlayerColor(playerid,color);
}
else
{
SetPlayerColor(playerid,COLOR_GREEN);
}
}
//i use this with timer..