
#include <a_samp>
#include <YSI\y_hooks>
#include <sscanf2>
#include <DOF2>
#define MAX_HQS 10
#define MAX_ORG_PORTOES 10
#define MAX_ORG_CARROS 20
#define MAX_ORG_MOTOS 10
#define MAX_ORG_HELIS 3
#define MAX_NOME_HQ 30
#define function%0(%1) forward %0(%1); public %0(%1)
main() { }
enum nhqinfo
{
OrgDona,
FamiliaDona,
HQNome[MAX_NOME_HQ],
}
new NikoHQInfo[MAX_HQS][nhqinfo];
public OnGameModeInit()
{
new hqId = 10;
format(NikoHQInfo[hqId][HQNome], MAX_NOME_HQ, "Sem Nome");
printf("nome = %s", NikoHQInfo[hqId][HQNome]);
NikoHQInfo[hqId][OrgDona] = 8;
printf("nome = %s", NikoHQInfo[hqId][HQNome]);
NikoHQInfo[hqId][FamiliaDona] = 0;
printf("nome = %s", NikoHQInfo[hqId][HQNome]);
NikoSalvarRegrasHQ(hqId);
DOF2_Exit();
}
function NikoSalvarRegrasHQ(hqId)
{
new arquivo[60];
format(arquivo,sizeof(arquivo),"/RPG/HQs/HQRegras%d.txt", hqId);
if(!fexist(arquivo))
DOF2_CreateFile(arquivo);
printf("nome = %s", NikoHQInfo[hqId][HQNome]);
DOF2_SetString(arquivo,"NomeHQ",NikoHQInfo[hqId][HQNome]);
DOF2_SetInt(arquivo,"OrgDona",NikoHQInfo[hqId][OrgDona]);
return 1;
}
enum nhqinfo
{
FamiliaDona,
HQNome[MAX_NOME_HQ],
OrgDona,
}
enum nhqinfo
{
HQNome[MAX_NOME_HQ],
OrgDona,
FamiliaDona,
}
enum nhqinfo
{
OrgDona,
FamiliaDona,
HQNome[MAX_NOME_HQ],
}
|
Array index is out of bounds. If you have 10 headquarters then the available slots are 0 through 9.
By the way, I misread those defines. Thought it said potatoes and carrots. :') |