Quote:
Originally Posted by Norn
Quote:
Originally Posted by Norn
Bump, i'm really stuck with this.
How could i detect which player character comes first/second/third etc, i can store the %s\n%s in a global variable. Wouldn't that be easier?
|
Update:
I created this,
pawn Code:
stock GetMenuDialogCharacterOrder(playerid, characterslotid) { new arrCoords[11][64], string[128]; if(characterslotid >= 1 && characterslotid <= 10) { format(string,sizeof(string),"%s", MasterAccount[playerid][mCharacterString]); split(string, arrCoords, '\n'); if(characterslotid == 1) return arrCoords[1]; else if(characterslotid == 2) return arrCoords[2]; else if(characterslotid == 3) return arrCoords[3]; else if(characterslotid == 4) return arrCoords[4]; else if(characterslotid == 5) return arrCoords[5]; else if(characterslotid == 6) return arrCoords[6]; else if(characterslotid == 7) return arrCoords[7]; else if(characterslotid == 8) return arrCoords[8]; else if(characterslotid == 9) return arrCoords[9]; else if(characterslotid == 10) return arrCoords[10]; } }
and it works, but arrCoords[0] is blank and the names don't start until arrCoords[1]. Why is that?
|
I'm sure it would be easier to:
pawn Code:
stock GetMenuDialogCharacterOrder(playerid, characterslotid)
{
new arrCoords[11][64], string[128];
if(characterslotid >= 1 && characterslotid <= 10)
{
format(string,sizeof(string),"%s", MasterAccount[playerid][mCharacterString]);
split(string, arrCoords, '\n');
return arrCoords[characterslotid];
}
}