18.09.2017, 06:46
PHP код:
#define MAX_CHARACTERS 3
PHP код:
ShowCharacterDialog(playerid) {
dialogstr[0] = 0;
tempstr[0] = 0;
new charname[MAX_PLAYER_NAME];
new pvarname[32];
new numchars = GetPVarInt(playerid,"NumCharacters");
for(new i=0;i<numchars;i++) {
format(pvarname,sizeof(pvarname),"CharUsername%d",i);
GetPVarString(playerid,pvarname,charname,sizeof(charname));
format(tempstr,sizeof(tempstr),"%s\n",charname);
strcat(dialogstr,tempstr,sizeof(dialogstr));
}
if(numchars < MAX_CHARACTERS) {
strcat(dialogstr,"Create Character",sizeof(dialogstr));
}
ShowPlayerDialog(playerid, _:EAccountDialog_ChooseCharacter, DIALOG_STYLE_LIST, "Choose your character",dialogstr,"Select", "Quit");
return 0;
}