Whats wrong here? Trying to make an command to edit offline players cash.
#1

pawn Код:
CMD:addcashoffline(playerid, params[])
{
    new offlineplayer[24], filestring[79], cash;
    if(sscanf(params, "s[24]i", offlineplayer, cash)) return SendClientMessage(playerid, COLOR_RED, "/addcashoff NAME CASH");
    format(filestring, sizeof(filestring), AccountsPath, offlineplayer[24]);
    if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "No palyer but that name");
    INI_ParseFile(filestring, "LoadAccountOffline_%s", .bExtra = true , .extra = offlineplayer[24]);
    new INI:File = INI_Open(filestring);
    INI_WriteInt(File, "Cash", PlayerData[offlineplayer[24]][pCash]+cash);
    INI_Close(File);
    format(gstring, sizeof(gstring), "%s now has $%d", offlineplayer[24], PlayerData[offlineplayer[24]][pCash]+cash);
    SendClientMessage(playerid, COLOR_RED, gstring);
    return 1;
}

forward LoadAccountOffline_user(offlineplayer[24], name[], value[]);
public LoadAccountOffline_user(offlineplayer[24], name[], value[])
{
    INI_Int("Cash", PlayerData[offlineplayer[24]][pCash]);
    return 1;
}
The error is error 032: array index out of bounds (variable "offlineplayer"), which all seems to relate to offlineplayer[24]

Thanks in advance
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)