27.01.2019, 08:57
hi! so, i typed some codes on player death , but some of them will not work ! and i get this lines on samp-server.exe
:
here is onplayerdeath code :
and the FailRob Public:
i tried to use failrob public codes in onplayerdeath to but not worked again and show same errors help me please!
:
Code:
[13:00:43] [debug] Run time error 4: "Array index out of bounds" [13:00:43] [debug] Attempted to read/write array element at index 99 in array of size 16 [13:00:43] [debug] AMX backtrace: [13:00:43] [debug] #0 000df064 in public FailRob (0, 1) in BlankScript.amx [13:00:43] [debug] #1 000df330 in public AB_OnPlayerDeath (0, 65535, 255) in BlankScript.amx [13:00:43] [debug] #2 00035f24 in public OnPlayerDeathWeapons (0, 65535, 255) in BlankScript.amx [13:00:43] [debug] #3 000319f0 in public ac_OnPlayerDeath (0, 65535, 255) in BlankScript.amx [13:00:43] [debug] #4 0000d348 in public OnPlayerDeath (0, 65535, 255) in BlankScript.amx
Code:
new Robber[MAX_PLAYERS]; new BankRobber[MAX_PLAYERS]; public OnPlayerDeath(playerid, killerid, reason) { if(Robber[playerid] != 0) { Robber[playerid] = 0; if(BankRobber[playerid] == 1) { BankRobber[playerid] = 0; FailRob(playerid,1); } } return 1; }
Code:
forward FailRob(playerid,robid); public FailRob(playerid,robid) { if(robid == 1) { SendClientMessageToAll(-1,"Test String"); // worked! DestroyDynamicCP(RobCps[playerid]); // not worked! // HideTimer(playerid); // not worked (this stock should hide some textdraws) } return 1; }