Bug with ShowStats
#1

Hello, when i type /stats, it doesnt show all of the stats info
whats wrong?



pawn Код:
new string[1500];
        new totalwealth, upgradep, lockerperk, toughperk;
        toughperk = PlayerInfo[targetid][pToughPerk];
        lockerperk = PlayerInfo[targetid][pGunLockerPerk];
        upgradep = PlayerInfo[targetid][gPupgrade];
        totalwealth = PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
        new phnumber[20];
        if(PlayerInfo[targetid][pPnumber] == 0) phnumber = "None"; else format(phnumber, sizeof(phnumber), "%d", PlayerInfo[targetid][pPnumber]);
        new briefcase[20];
        if(PlayerInfo[targetid][pBriefCase] == 0) briefcase = "None"; else format(briefcase, sizeof(briefcase), "Yes", PlayerInfo[targetid][pBriefCase]);
        totalwealth = PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
        format(string, sizeof(string), "Account - "GRE"Name: "WHITE"%s"GRE"  Level: "WHITE"%d"GRE"  Playtime: "WHITE"%d"GRE"  Paydays: "WHITE"%d"GRE"  Respect: "WHITE"%d/%d"GRE"  Phone: "WHITE"%s",Name(targetid),PlayerInfo[targetid][pLevel],floatround(PlayerInfo[targetid][pPlayTime] / 3600,floatround_floor),PlayerInfo[targetid][pConnectTime],PlayerInfo[targetid][pExp],expamount,phnumber);
        SendClientMessage(playerid, COLOR_SZR,string);
        format(string, sizeof(string), "Details - "GRE"Money: "WHITE"$%s"GRE"  Bank: "WHITE"$%s"GRE"  Total wealth: "WHITE"$%s"GRE"  Job: "WHITE"%s",Comma(PlayerInfo[targetid][pCash]),Comma(PlayerInfo[targetid][pAccount]),Comma(totalwealth),jtext);
        SendClientMessage(playerid, COLOR_SZR,string);
        format(string, sizeof(string), "Details - "GRE"Married to: "WHITE"%s"GRE"  Gang: "WHITE"%d"GRE"  Warnings: "WHITE"%d"GRE"  Donator level: "WHITE"%d",married,PlayerInfo[targetid][pGang],PlayerInfo[targetid][pWarns],PlayerInfo[targetid][pDonatorLevel]);
        SendClientMessage(playerid, COLOR_SZR,string);
        if((playerid == targetid) || (PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)){
            format(string, sizeof(string), "Upgrades - "GRE"Points: "WHITE"%d"GRE"  Gunlocker: "WHITE"%d"GRE"  Toughness: "WHITE"%d"GRE"  Respect: "WHITE"%d"GRE"  Armor: "WHITE"%d"GRE"  Recovery: "WHITE"%d"GRE"  Next Level: "WHITE"$%s",upgradep,lockerperk,toughperk,PlayerInfo[targetid][pRespectPerk],PlayerInfo[targetid][pArmorPerk],PlayerInfo[targetid][pRecoveryPerk],Comma(costlevel));
            SendClientMessage(playerid, COLOR_SZR,string);
        }
        format(string, sizeof(string), "Crimes - "GRE"Wanted level: "WHITE"%d"GRE"  Committed: "WHITE"%d"GRE"  Arrested: "WHITE"%d"GRE"  Kills: "WHITE"%d"GRE" Deaths: "WHITE"%d"GRE"  Wanted deaths: "WHITE"%d",WantedLevel[targetid],PlayerInfo[targetid][pCrimes],PlayerInfo[targetid][pArrested],PlayerInfo[targetid][pKills],PlayerInfo[targetid][pDeaths],PlayerInfo[targetid][pWantedDeaths]);
        SendClientMessage(playerid, COLOR_SZR,string);
        format(string, sizeof(string),"Faction - "GRE"Team: "WHITE"%s"GRE"  Organization: "WHITE"%s"GRE"  Rank: "WHITE"%s",ttext,ftext,rtext);
        SendClientMessage(playerid, COLOR_SZR,string);
        new chours = ((12 - PlayerInfo[targetid][pContractTime]) * 5);
        if((playerid == targetid) || (PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)){
            format(string, sizeof(string), "Extras - "GRE"Check number: "WHITE"%d"GRE"  Disease: "WHITE"%s"GRE"  Job contract time left: "WHITE"%d min",PlayerInfo[targetid][pCheckNumber],dtext,chours);
            SendClientMessage(playerid, COLOR_SZR,string);
        }
        // if player is admin, show extra info
        if ((PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS))
        {
            format(string, sizeof(string), "Admin: "GRE"Skin "WHITE"%d"GRE"  Head Value "WHITE"$%d"GRE"  PSock "WHITE"-$%d"GRE"  Idle for "WHITE"%d min",PlayerInfo[targetid][pModel],PlayerInfo[targetid][pHeadValue],PlayerInfo[targetid][pSock],PlayerInfo[targetid][pIdleMinutes]);
            SendClientMessage(playerid, COLOR_SZR,string);
        }
Reply
#2

try to add more string new string[1500]; new string[2000];
Reply
#3

Quote:
Originally Posted by OKOK
Посмотреть сообщение
try to add more string new string[1500]; new string[2000];
I have tried that already, its not working
Reply
#4

Anyone?
Reply
#5

The Problem
Reply
#6

Quote:
Originally Posted by RamzyR
Посмотреть сообщение
The Problem
It does only show 4 lines of the ShowStats function
Reply
#7

try this one sir
PHP код:
        new string[1500];
        new 
totalwealthupgradeplockerperktoughperk;
        
toughperk PlayerInfo[targetid][pToughPerk];
        
lockerperk PlayerInfo[targetid][pGunLockerPerk];
        
upgradep PlayerInfo[targetid][gPupgrade];
        
totalwealth PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
        new 
phnumber[20];
        if(
PlayerInfo[targetid][pPnumber] == 0phnumber "None"; else format(phnumbersizeof(phnumber), "%d"PlayerInfo[targetid][pPnumber]);
        new 
briefcase[20];
        if(
PlayerInfo[targetid][pBriefCase] == 0briefcase "None"; else format(briefcasesizeof(briefcase), "Yes"PlayerInfo[targetid][pBriefCase]);
        
totalwealth PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
        
format(stringsizeof(string), "Account - "GRE"Name: "WHITE"%s"GRE"  Level: "WHITE"%d"GRE"  Playtime: "WHITE"%d"GRE"  Paydays: "WHITE"%d"GRE"  Respect: "WHITE"%d/%d"GRE"  Phone: "WHITE"%s",Name(targetid),PlayerInfo[targetid][pLevel],floatround(PlayerInfo[targetid][pPlayTime] / 3600,floatround_floor),PlayerInfo[targetid][pConnectTime],PlayerInfo[targetid][pExp],expamount,phnumber);
        
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string), "Details - "GRE"Money: "WHITE"$%s"GRE"  Bank: "WHITE"$%s"GRE"  Total wealth: "WHITE"$%s"GRE"  Job: "WHITE"%s",Comma(PlayerInfo[targetid][pCash]),Comma(PlayerInfo[targetid][pAccount]),Comma(totalwealth),jtext);
        
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string), "Details - "GRE"Married to: "WHITE"%s"GRE"  Gang: "WHITE"%d"GRE"  Warnings: "WHITE"%d"GRE"  Donator level: "WHITE"%d",married,PlayerInfo[targetid][pGang],PlayerInfo[targetid][pWarns],PlayerInfo[targetid][pDonatorLevel]);
        
SendClientMessage(playeridCOLOR_SZR,string);
        if((
playerid == targetid) || (PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)){
            
format(stringsizeof(string), "Upgrades - "GRE"Points: "WHITE"%d"GRE"  Gunlocker: "WHITE"%d"GRE"  Toughness: "WHITE"%d"GRE"  Respect: "WHITE"%d"GRE"  Armor: "WHITE"%d"GRE"  Recovery: "WHITE"%d"GRE"  Next Level: "WHITE"$%s",upgradep,lockerperk,toughperk,PlayerInfo[targetid][pRespectPerk],PlayerInfo[targetid][pArmorPerk],PlayerInfo[targetid][pRecoveryPerk],Comma(costlevel));
            
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string), "Crimes - "GRE"Wanted level: "WHITE"%d"GRE"  Committed: "WHITE"%d"GRE"  Arrested: "WHITE"%d"GRE"  Kills: "WHITE"%d"GRE" Deaths: "WHITE"%d"GRE"  Wanted deaths: "WHITE"%d",WantedLevel[targetid],PlayerInfo[targetid][pCrimes],PlayerInfo[targetid][pArrested],PlayerInfo[targetid][pKills],PlayerInfo[targetid][pDeaths],PlayerInfo[targetid][pWantedDeaths]);
        
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string),"Faction - "GRE"Team: "WHITE"%s"GRE"  Organization: "WHITE"%s"GRE"  Rank: "WHITE"%s",ttext,ftext,rtext);
        
SendClientMessage(playeridCOLOR_SZR,string);
        new 
chours = ((12 PlayerInfo[targetid][pContractTime]) * 5);
        if((
playerid == targetid) || (PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)){
            
format(stringsizeof(string), "Extras - "GRE"Check number: "WHITE"%d"GRE"  Disease: "WHITE"%s"GRE"  Job contract time left: "WHITE"%d min",PlayerInfo[targetid][pCheckNumber],dtext,chours);
            
SendClientMessage(playeridCOLOR_SZR,string);
        }
        
// if player is admin, show extra info
        
if ((PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS))
        {
            
format(stringsizeof(string), "Admin: "GRE"Skin "WHITE"%d"GRE"  Head Value "WHITE"$%d"GRE"  PSock "WHITE"-$%d"GRE"  Idle for "WHITE"%d min",PlayerInfo[targetid][pModel],PlayerInfo[targetid][pHeadValue],PlayerInfo[targetid][pSock],PlayerInfo[targetid][pIdleMinutes]);
            
SendClientMessage(playeridCOLOR_SZR,string);
        } 
Reply
#8

Quote:
Originally Posted by Younes44
Посмотреть сообщение
try this one sir
PHP код:
        new string[1500];
        new 
totalwealthupgradeplockerperktoughperk;
        
toughperk PlayerInfo[targetid][pToughPerk];
        
lockerperk PlayerInfo[targetid][pGunLockerPerk];
        
upgradep PlayerInfo[targetid][gPupgrade];
        
totalwealth PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
        new 
phnumber[20];
        if(
PlayerInfo[targetid][pPnumber] == 0phnumber "None"; else format(phnumbersizeof(phnumber), "%d"PlayerInfo[targetid][pPnumber]);
        new 
briefcase[20];
        if(
PlayerInfo[targetid][pBriefCase] == 0briefcase "None"; else format(briefcasesizeof(briefcase), "Yes"PlayerInfo[targetid][pBriefCase]);
        
totalwealth PlayerInfo[targetid][pCash]+PlayerInfo[targetid][pAccount];
        
format(stringsizeof(string), "Account - "GRE"Name: "WHITE"%s"GRE"  Level: "WHITE"%d"GRE"  Playtime: "WHITE"%d"GRE"  Paydays: "WHITE"%d"GRE"  Respect: "WHITE"%d/%d"GRE"  Phone: "WHITE"%s",Name(targetid),PlayerInfo[targetid][pLevel],floatround(PlayerInfo[targetid][pPlayTime] / 3600,floatround_floor),PlayerInfo[targetid][pConnectTime],PlayerInfo[targetid][pExp],expamount,phnumber);
        
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string), "Details - "GRE"Money: "WHITE"$%s"GRE"  Bank: "WHITE"$%s"GRE"  Total wealth: "WHITE"$%s"GRE"  Job: "WHITE"%s",Comma(PlayerInfo[targetid][pCash]),Comma(PlayerInfo[targetid][pAccount]),Comma(totalwealth),jtext);
        
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string), "Details - "GRE"Married to: "WHITE"%s"GRE"  Gang: "WHITE"%d"GRE"  Warnings: "WHITE"%d"GRE"  Donator level: "WHITE"%d",married,PlayerInfo[targetid][pGang],PlayerInfo[targetid][pWarns],PlayerInfo[targetid][pDonatorLevel]);
        
SendClientMessage(playeridCOLOR_SZR,string);
        if((
playerid == targetid) || (PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)){
            
format(stringsizeof(string), "Upgrades - "GRE"Points: "WHITE"%d"GRE"  Gunlocker: "WHITE"%d"GRE"  Toughness: "WHITE"%d"GRE"  Respect: "WHITE"%d"GRE"  Armor: "WHITE"%d"GRE"  Recovery: "WHITE"%d"GRE"  Next Level: "WHITE"$%s",upgradep,lockerperk,toughperk,PlayerInfo[targetid][pRespectPerk],PlayerInfo[targetid][pArmorPerk],PlayerInfo[targetid][pRecoveryPerk],Comma(costlevel));
            
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string), "Crimes - "GRE"Wanted level: "WHITE"%d"GRE"  Committed: "WHITE"%d"GRE"  Arrested: "WHITE"%d"GRE"  Kills: "WHITE"%d"GRE" Deaths: "WHITE"%d"GRE"  Wanted deaths: "WHITE"%d",WantedLevel[targetid],PlayerInfo[targetid][pCrimes],PlayerInfo[targetid][pArrested],PlayerInfo[targetid][pKills],PlayerInfo[targetid][pDeaths],PlayerInfo[targetid][pWantedDeaths]);
        
SendClientMessage(playeridCOLOR_SZR,string);
        
format(stringsizeof(string),"Faction - "GRE"Team: "WHITE"%s"GRE"  Organization: "WHITE"%s"GRE"  Rank: "WHITE"%s",ttext,ftext,rtext);
        
SendClientMessage(playeridCOLOR_SZR,string);
        new 
chours = ((12 PlayerInfo[targetid][pContractTime]) * 5);
        if((
playerid == targetid) || (PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)){
            
format(stringsizeof(string), "Extras - "GRE"Check number: "WHITE"%d"GRE"  Disease: "WHITE"%s"GRE"  Job contract time left: "WHITE"%d min",PlayerInfo[targetid][pCheckNumber],dtext,chours);
            
SendClientMessage(playeridCOLOR_SZR,string);
        }
        
// if player is admin, show extra info
        
if ((PlayerInfo[playerid][pAdmin] & ADMIN_EDITCHAR) || (PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS))
        {
            
format(stringsizeof(string), "Admin: "GRE"Skin "WHITE"%d"GRE"  Head Value "WHITE"$%d"GRE"  PSock "WHITE"-$%d"GRE"  Idle for "WHITE"%d min",PlayerInfo[targetid][pModel],PlayerInfo[targetid][pHeadValue],PlayerInfo[targetid][pSock],PlayerInfo[targetid][pIdleMinutes]);
            
SendClientMessage(playeridCOLOR_SZR,string);
        } 
Well, that is just giving me alot of random errors
Reply
#9

Anyone?
Reply
#10

I honestly can't be bothered to read through the code. It's too messy.

You don't need a string of size 1500, since you're printing each formatted message at a time and none of them come close to 1500 characters. I would just put debug messages across the command to make sure all strings are formatted correctly.
Reply


Forum Jump:


Users browsing this thread: