18.01.2017, 15:36
I need to clear out a variable with enums. How can I clear out the whole variable without having to write a long code?
This is my code:
And I this is what I get in the console:
This is my code:
PHP код:
enum mapstats
{
Name[126],
Float:Center[3],
Float:Radius,
Float:Green1[3],
Float:Green2[3],
Float:Green3[3],
Float:Purple1[3],
Float:Purple2[3],
Float:Purple3[3],
}
new Edit[MAX_PLAYERS][mapstats];
PHP код:
for(new i; mapstats:i <= mapstats; i++)
{
Edit[playerid][mapstats:i] = -1;
printf("Edit[playerid][mapstats:i] = %i", Edit[playerid][mapstats:i]);
}
Код:
Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 Edit[playerid][mapstats:i] = -1 [debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 148 past array upper bound 147 [debug] AMX backtrace: [debug] #0 0001c8c4 in public dialog_maps (0, 1, 0, 1764228) from game.amx [debug] #1 native CallLocalFunction () from samp-server.exe [debug] #2 000007e8 in public OnDialogResponse (0, 32700, 1, 0, 1764148) from game.amx