Statsregister date problйm
#1

i Don't Know why the Register date don't Work it was Working But when i added the React and Math he Didn't Worked +rep if u helped me

PHP код:
YCMD:stats(playerid,params[], help)
{
    
#pragma unused help
     #pragma unused params
    
new string[256], string2[256],str[256];
    new 
TargetIDhms;
    new 
pDeaths;
    if(!
strlen(params)) TargetID playerid;
    else 
TargetID strval(params);
    if(
Account[TargetID][Deaths] == 0pDeaths 1;
    else 
pDeaths Account[TargetID][Deaths];
    
TotalGameTime(TargetIDhms);
    
format(stringsizeof(string),"{22B998}Kills:\t\t\t%d\n",Account[TargetID][Kills]);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Deaths:\t\t\t%d\n",Account[TargetID][Deaths]);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Ratio:\t\t\t%0.2f\n",Float:Account[TargetID][Kills]/Float:pDeaths);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Score:\t\t\t%d\n",GetPlayerScore(TargetID));
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Money:\t\t\t%d$\n",GetPlayerMoney(TargetID));
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}React Wins:\t\t\t%d\n",Account[TargetID][accountReact]);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Math Wins:\t\t\t%d\n",Account[TargetID][accountMath]);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Game Time:\t\t\t%d h,%d m,%d s\n",h,m,s);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Donator:\t\t%d\n",Account[TargetID][VipLevel]);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Admin Level:\t\t%d\n",Account[TargetID][Level]);
    
strcat(string2,string);
    
format(stringsizeof(string),"{22B998}Registered Date:\t%s\n",Account[TargetID][RegisteredDate]);
    
strcat(string2,string);
    
format(str,sizeof(str),"{FF4444}-=-Stats from %s",GetName(TargetID));
    return 
ShowPlayerDialog(playerid2002DIALOG_STYLE_MSGBOXstrstring2"OK","");

Reply
#2

Help
Reply
#3

What about increasing string2?
Reply
#4

Quote:
Originally Posted by Matess
Посмотреть сообщение
What about increasing string2?
Only this Line Don't Work Check the Pic
PHP код:
    format(stringsizeof(string),"{22B998}Registered Date:\t%s\n",Account[TargetID][RegisteredDate]); 
    
strcat(string2,string); 
Reply
#5

Then increase the string!
string2[256] -> string2[300]

I checked the pic and i can't see the colon after "Date" so listen me next time...
Reply
#6

Don't Work
Reply
#7

Check on save and load area maybe that not saving it
Reply
#8

Try this
pawn Код:
YCMD:stats(playerid,params[], help)
{
    #pragma unused help
    #pragma unused params
   
    new string[256], string2[512];
    new h, m, s;
    new TargetID, pDeaths;
   
    if(!strlen(params)) TargetID = playerid;
    else TargetID = strval(params);
   
    if(Account[TargetID][Deaths] == 0) pDeaths = 1;
    else pDeaths = Account[TargetID][Deaths];
   
    TotalGameTime(TargetID, h, m, s);

    format(string, sizeof(string),"{22B998}Kills:\t\t\t%d\n",Account[TargetID][Kills]);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Deaths:\t\t\t%d\n",Account[TargetID][Deaths]);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Ratio:\t\t\t%0.2f\n",Float:Account[TargetID][Kills]/Float:pDeaths);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Score:\t\t\t%d\n",GetPlayerScore(TargetID));
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Money:\t\t\t%d$\n",GetPlayerMoney(TargetID));
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}React Wins:\t\t%d\n",Account[TargetID][accountReact]);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Math Wins:\t\t%d\n",Account[TargetID][accountMath]);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Game Time:\t\t\t%d h,%d m,%d s\n",h,m,s);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Donator:\t\t%d\n",Account[TargetID][VipLevel]);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Admin Level:\t\t%d\n",Account[TargetID][Level]);
    strcat(string2,string);
    format(string, sizeof(string),"{22B998}Registered Date:\t%s", Account[TargetID][RegisteredDate]);
    strcat(string2,string);
   
    printf("[DEBUG] %s", Account[TargetID][RegisteredDate]);
   
    format(string,sizeof(string),"{FF4444}-=-Stats from %s",GetName(TargetID));
    return ShowPlayerDialog(playerid, 2002, DIALOG_STYLE_MSGBOX, string, string2, "OK","");
}
If doesn't work, check what prints on your server log/console
Reply
#9

Don't Work and this is the Debug
Quote:

[14:35:14] Number of vehicle models: 0
[14:35:35] [DEBUG]

Reply
#10

Quote:
Originally Posted by Humza
Посмотреть сообщение
Check on save and load area maybe that not saving it
Yes Maybe there are a Problйm In Register date.
Code
PHP код:
 enum AccountInfo
 
{
....
    
RegisteredDate[128],
....
 }; 
OnDialogResponse
PHP код:
INI_WriteString(file,"RegisteredDate 
Load PlayerData
PHP код:
    INI_String("RegisteredDate",Account[playerid][RegisteredDate],128); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)