04.07.2013, 00:00
Its not printf, the problem is that your code crashes due to an array out of bounds error
Next time try the crashdetect plugin which would have told you
In both loops you do
But you actually wanted to do
So fixed it could look like
Next time try the crashdetect plugin which would have told you
In both loops you do
pawn Code:
for(new i; i < sizeof(Contact); i++) // i < MAX_PLAYERS
pawn Code:
for(new i; i < sizeof(Contact[]); i++) // i < MAX_CONTACTS
pawn Code:
//
for(new i, text[32] = "None"; i < sizeof Contact[]; i++) {
Contact[playerid][i][ContactName] = text;
Contact[playerid][i][ContactNumber] = 0;
}
pawn Code:
//
new
str[MAX_CONTACTS * 38] = "Lisa uus kontakt"
;
for(new i; i < sizeof Contact[]; i++) {
format(str, sizeof str, "%s\n%s (%d)", str, Contact[playerid][i][ContactName], Contact[playerid][i][ContactNumber]);
}
TELEFON_valik[playerid] = 10;
ShowPlayerDialog(playerid, DIALOG_TELEFON, DIALOG_STYLE_LIST, "Telefon (Kontaktid)", str, "Vali", "Katkesta");