Nitro Errors
#1

pawn Код:
#include <a_samp>

new bool:AutoNOS[MAX_PLAYERS];

public OnFilterScriptInit()
{
    AutoNOS[MAX_PLAYERS] = true;
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && AutoNOS[playerid] && (newkeys & KEY_ACTION || newkeys & KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
    return 1;
}
Error:

pawn Код:
C:\Users\matt\Desktop\GB; Freeroam\filterscripts\nitro.pwn(7) : error 032: array index out of bounds (variable "AutoNOS")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && AutoNOS[playerid] && newkeys & KEY_ACTION || newkeys & KEY_FIRE) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
Reply
#3

pawn Код:
public OnFilterScriptInit()
{
    AutoNOS[MAX_PLAYERS] = true;
    return 1;
}
That's not how it works! Remove that and use this declaration instead:

pawn Код:
new bool:AutoNOS[MAX_PLAYERS] = {true, ...};
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)