11.01.2019, 08:08
hi guys, i am getting an error for my dropmoney cmd
Код:
(177) : error 009: invalid array size (negative, zero or out of bounds) (179) : error 009: invalid array size (negative, zero or out of bounds)
pawn Код:
new MoneyPickup[]; // Line 177
new MoneyPickupID;
new PickupAmount[]; // Line 179
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i < 500; i++)
{
if(MoneyPickupID == MoneyPickup[i])
{
new string[256];
GivePlayerMoney(playerid, PickupAmount[i]);
format(string, sizeof(string), "System: You picked up the money bag and received $%d", PickupAmount[i]);
SCM(playerid, green, string);
DestroyPickup(MoneyPickup[i]);
}
}
return 1;
}
CMD:dropmoney(playerid, params[])
{
new string[256], money, Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(sscanf(params, "i", money)) return SCM(playerid, yellow, "Syntax: /dropmoney [amount]");
MoneyPickup[MoneyPickupID] = CreatePickup(1550, 19, X+2, Y, Z, 0);
PickupAmount[MoneyPickupID] = money;
MoneyPickupID++;
format(string, sizeof(string), "System: You have dropped $%d", money);
SCM(playerid, success, string);
return 1;
}