SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/01/2020, 07:17 PM   #1
itachi
Big Clucker
 
Join Date: Jul 2010
Location: Czech Republic
Posts: 180
Reputation: 2
Default STATS NO SHOW

My stats in /info no show dialog

Code:
CMD:info(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		new string[1024],storage[200];
		format(string, sizeof(string), "{F81414}Info hráče {FFFFFF}%s\n", Jmeno(playerid));
		strcat(string,storage);
		format(string, sizeof(string), "{FFFFFF}ZÁKLADNÍ INFO\n");
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}Dni: {FFFFFF}%d\n{F81414}Hodin: {FFFFFF}%d\n{F81414}Minut: {FFFFFF}%d\n", Dni[playerid], Hodin[playerid], Minut[playerid]);
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}Banka: {FFFFFF}%s$\n{F81414}Peníze: {FFFFFF}%s$\n{F81414}Firma %s$\n{F81414}Dům číslo: {FFFFFF}%d\n",Split(Banka[playerid]), Split(GetMoney(playerid)), Split(Firma[playerid]), glob16310[playerid]);
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}Marihuana: {FFFFFF}%d\n{F81414}Alkohol: {FFFFFF}%d\n{F81414}WantedLevel: {FFFFFF}%d\n", glob15080[playerid], GetPlayerDrunkLevel(playerid), GetPlayerWantedLevel(playerid));
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}Zabil jste: {FFFFFF}%d\n{F81414}Umřel jste: {FFFFFF}%d\n{F81414}Bomba: {FFFFFF}%d\n", glob15398[playerid], glob15524[playerid], glob1520C[playerid]);
		strcat(string,storage);
		format(string, sizeof(string), "{FFFFFF}PRŮKAZY A ZKUŠENOSTI\n");
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}Řidický průkaz: {FFFFFF}%d\n{F81414}Letecký průkaz: {FFFFFF}%d\n{F81414}Lodní průkaz: {FFFFFF}%d\n", glob12B60[playerid], glob13190[playerid], glob14108[playerid]);
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}Zbrojní průkaz: {FFFFFF}%d\n{F81414}Pas: {FFFFFF}%d]\n", glob129D4[playerid], glob15FF8[playerid]);
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}PolicejníZK: {FFFFFF}%d\n{F81414}MafianskéZK: {FFFFFF}%d\n{F81414}VojenskéZK: {FFFFFF}%d\n", glob11BE8[playerid], glob11D74[playerid], glob123A4[playerid]);
		strcat(string,storage);
		format(string, sizeof(string), "{F81414}ŘidickéZK: {FFFFFF}%d\n{F81414}LeteckéZK: {FFFFFF}%d\n", glob12CEC[playerid], glob12E78[playerid]);
		strcat(string,storage);
		ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "INFORMACE",string,"OK","");
	}
	return 1;
}
itachi is offline   Reply With Quote
Old 01/01/2020, 08:08 PM   #2
Vizi10
Huge Clucker
 
Join Date: May 2017
Location: Iran
Posts: 286
Reputation: 8
Default Re: STATS NO SHOW

Increase `storage` size.
Vizi10 is offline   Reply With Quote
Old 02/01/2020, 11:40 AM   #3
ShadowMortar
Big Clucker
 
ShadowMortar's Avatar
 
Join Date: Jul 2016
Location: Croatia
Posts: 146
Reputation: 24
Default Re: STATS NO SHOW

Because
PHP Code:
strcatdest[ ], const source[ ], maxlength=sizeof dest 
And you are formating STRING instead of STORAGE, and using strcat on STRING as a destination while STORAGE = EOS ( empty string ).
You should format STORAGE, then it'll work.
Should be like this:
PHP Code:
CMD:info(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
string[1024],storage[200];
        
format(storagesizeof(storage), "{F81414}Info hráče {FFFFFF}%s\n"Jmeno(playerid));
        
strcat(string,storage);
        
format(storagesizeof(storage), "{FFFFFF}ZÁKLADNÍ INFO\n");
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}Dni: {FFFFFF}%d\n{F81414}Hodin: {FFFFFF}%d\n{F81414}Minut: {FFFFFF}%d\n"Dni[playerid], Hodin[playerid], Minut[playerid]);
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}Banka: {FFFFFF}%s$\n{F81414}Peníze: {FFFFFF}%s$\n{F81414}Firma %s$\n{F81414}Dům číslo: {FFFFFF}%d\n",Split(Banka[playerid]), Split(GetMoney(playerid)), Split(Firma[playerid]), glob16310[playerid]);
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}Marihuana: {FFFFFF}%d\n{F81414}Alkohol: {FFFFFF}%d\n{F81414}WantedLevel: {FFFFFF}%d\n"glob15080[playerid], GetPlayerDrunkLevel(playerid), GetPlayerWantedLevel(playerid));
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}Zabil jste: {FFFFFF}%d\n{F81414}Umřel jste: {FFFFFF}%d\n{F81414}Bomba: {FFFFFF}%d\n"glob15398[playerid], glob15524[playerid], glob1520C[playerid]);
        
strcat(string,storage);
        
format(storagesizeof(storage), "{FFFFFF}PRŮKAZY A ZKUŠENOSTI\n");
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}Řidický průkaz: {FFFFFF}%d\n{F81414}Letecký průkaz: {FFFFFF}%d\n{F81414}Lodní průkaz: {FFFFFF}%d\n"glob12B60[playerid], glob13190[playerid], glob14108[playerid]);
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}Zbrojní průkaz: {FFFFFF}%d\n{F81414}Pas: {FFFFFF}%d]\n"glob129D4[playerid], glob15FF8[playerid]);
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}PolicejníZK: {FFFFFF}%d\n{F81414}MafianskéZK: {FFFFFF}%d\n{F81414}VojenskéZK: {FFFFFF}%d\n"glob11BE8[playerid], glob11D74[playerid], glob123A4[playerid]);
        
strcat(string,storage);
        
format(storagesizeof(storage), "{F81414}ŘidickéZK: {FFFFFF}%d\n{F81414}LeteckéZK: {FFFFFF}%d\n"glob12CEC[playerid], glob12E78[playerid]);
        
strcat(string,storage);
        
ShowPlayerDialog(playerid999DIALOG_STYLE_MSGBOX"INFORMACE",string,"OK","");
    }
    return 
1;

__________________
Quote:
Originally Posted by CheezIt View Post
Follow your heart and own style.
Feel free to PM me if you need help.
ShadowMortar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
show stats bug Learn Scripting Help 1 07/01/2017 11:52 AM
/stats only show time Sh4d0w2 Scripting Help 7 17/10/2015 09:21 AM
How can my /stats command be modified to show more stats? K9IsGodly Scripting Help 3 13/04/2014 06:48 PM
/stats won't show up anymore.. whando Scripting Help 8 12/04/2014 09:03 PM
show stats help Tom1412 Scripting Help 6 25/10/2011 04:06 AM


All times are GMT. The time now is 02:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.