22.01.2014, 14:19
As I am developing a gamemode I want to make it faster and create as much as case's except if and else statements. Although there is a problem occuring, and I'm not sure how to fix it, I'm also not sure if I can use this in a case.
This error seems to show up:
If somebody could help that would be great, as this is a great way to speed up my slow script.
The script looks a bit messed up although it looks good in pawno itself.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_NO)
{
switch(LootObjects[MAX_LOOTS])
{
case 0:
{
if(IsPlayerInRangeOfPoint(playerid,2.0,254.02530, 4084.52393, 0.42032))
{
AddItem(playerid,"Dead Deer", 1);
SendClientMessage(playerid, COLOR_GREEN, TEXT_INV_DEAD);
DestroyObject(LootObjects[0]);
}
}
}
return 0;
}
Код:
E:\SAMP\RPG all\RPG\gamemodes\rc-apo.pwn(511) : error 032: array index out of bounds (variable "LootObjects")
The script looks a bit messed up although it looks good in pawno itself.