help please, thanks.
#1

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_ChooseCharacterDIALOG_STYLE_LIST"Choose your character",dialogstr,"Select""Quit");
    return 
0;

It sets the MAX Characters to the defined limit.. but now I want to create a cmd where I want an admin to set char limit for each player using playerid but I do not know how I can I achieve that.. using the same function.
Reply
#2

it's to do with
Код:
if(numchars < MAX_CHARACTERS)
where it could be

Код:
if(numchars < MAX_CHARACTERS||numchars < PlayerCharLimit[playerid])
You will need to change in other areas to match this, such as where they select the character, and where they create their account.

Set PlayerCharLimit on creation, to MAX_CHARACTERS. Use the command to change PlayerCharLimit, and save it to the account, then make the login system load that limit once they login.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)