[REQ] Contact system DIALOG
#1

Hi. I wanted to make the System Contacts (Phone Number) with dialog. But i got problem with this. Compiler is ok but it not working.

Anyone can tell me what problem with my script ?

Thanks for help.

PHP код:
enum dbInfo
{
    
dbID,
    
dbName1[30],
    
dbName2[30],
    
dbName3[30],
    
dbName4[30],
    
dbName5[30],
    
dbName6[30],
    
dbName7[30],
    
dbName8[30],
    
dbName9[30],
    
dbName10[30],
    
dbName11[30],
    
dbName12[30],
    
dbName13[30],
    
dbName14[30],
    
dbName15[30],
    
dbName16[30],
    
dbName17[30],
    
dbName18[30],
    
dbName19[30],
    
dbName20[30],
    
dbSDT[20],
};
new    
DBInfo[MAX_PLAYERS][MAX_DANHBA][dbInfo];
CMD:test(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        for(new 
0MAX_DANHBAi++)
        {
            new 
string[512];
            
format(stringsizeof(string),"Username\tPhone Number\n%s\t%d",DBInfo[playerid][i][dbName1],DBInfo[playerid][1][dbSDT][1]);
            
ShowPlayerDialog(playerid,DIALOG_NOTHING,DIALOG_STYLE_TABLIST_HEADERS,"Contacts",string,"Call","Cancel");
        }
    }
}
CMD:savenumber (playeridparams[])
{
    new 
giveplayerid;
    if(
sscanf(params"u"giveplayerid))
    {
        
SendClientMessageEx(playeridCOLOR_GREY"USAGE: /savenumber [user]");
        return 
1;
    }
    for(new 
0MAX_DANHBAi++)
    {
        
format(DBInfo[playerid][i][dbName1], 32"%s"GetPlayerNameEx(giveplayerid));
        
DBInfo[playerid][1][dbSDT][1] = PlayerInfo[giveplayerid][pPnumber];
        
SaveContact(playerid1);
        return 
1;
    }
    return 
1;

Reply
#2

MAX_DANHBA is #define 30
Reply
#3

Hello!

What exactly does not work?
Maybe you should printing the codes.

Mencent
Reply
#4

Username&Number can't displayed on DiALOG with cmd TEst
Reply
#5

Write it so, it's very better for the performance:
PHP код:
new dbID[20],dbName[20][MAX_PLAYER_NAME],dbSDT[20];//global
CMD:test(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        new 
string[512];
        for(new 
i;i<20;i++)
        {
            if(!
dbSDT[i])continue;
            
format(string,sizeof string,"%sUsername\tPhone Number\n%s\t%d\n",string,dbName[i],dbSDT[i]);
        }
        
ShowPlayerDialog(playerid,DIALOG_NOTHING,DIALOG_STYLE_TABLIST_HEADERS,"Contacts",string,"Call","Cancel");
    }
    return 
1;
}
CMD:savenumber (playeridparams[])
{
    new 
giveplayerid;
    if(
sscanf(params"u"giveplayerid))
    {
        
SendClientMessageEx(playeridCOLOR_GREY"USAGE: /savenumber [user]");
        return 
1;
    }
    for(new 
i;i<20;i++)
    {
        if(!
strlen(dbName[i]))
        {
            
format(dbName[i],MAX_PLAYER_NAME,GetPlayerNameEx(giveplayerid));
            
dbSDT[i] = PlayerInfo[giveplayerid][pPnumber];
            
SaveContact(playerid,i);
            return 
1;
        }
    }
    return 
1;

Mencent
Reply
#6

with gobal variables like that i can't save the phonebook. There have the way for make them on enum ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)