SA-MP Forums Archive
Money textdraw? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Money textdraw? (/showthread.php?tid=267009)



Money textdraw? - Outcast - 06.07.2011

Is it possible to remove/hide the existing HUD for money, so I can add my own textdraw? Also, what is the HEX code of the GTA:SA money font color? Thanks.


Re: Money textdraw? - ppeterpp - 06.07.2011

PHP код:
#include <a_samp>
new Text:Box[MAX_PLAYERS];
new 
Text:Ft[MAX_PLAYERS];
new 
check;
public 
OnFilterScriptInit()
{
    print(
"\n|==========================================================|");
    print(
"\n|                        Forint script                     |");
    print(
"\n|                           Betцltve                       |");
    print(
"\n|==========================================================|");
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"\n|==========================================================|");
    print(
"\n|                        Forint script                     |");
    print(
"\n|                         Kikapcsolva                      |");
    print(
"\n|==========================================================|");
    
KillTimer(check);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
Box[playerid] = TextDrawCreate(622.00000079.000000"   ");
    
TextDrawBackgroundColor(Box[playerid], 255);
    
TextDrawFont(Box[playerid], 1);
    
TextDrawLetterSize(Box[playerid], 0.5000001.000000);
    
TextDrawColor(Box[playerid], -1);
    
TextDrawSetOutline(Box[playerid], 0);
    
TextDrawSetProportional(Box[playerid], 1);
    
TextDrawSetShadow(Box[playerid], 1);
    
TextDrawUseBox(Box[playerid], 1);
    
TextDrawBoxColor(Box[playerid], 0x000035FF);
    
TextDrawTextSize(Box[playerid], 483.00000049.000000);
    
Ft[playerid] = TextDrawCreate(490.00000077.000000"00000000Ft"); //a forint mindenhol legelől volt
    
TextDrawBackgroundColor(Ft[playerid], 0xF5F51FFF);
    
TextDrawFont(Ft[playerid], 1);
    
TextDrawLetterSize(Ft[playerid], 0.5399992.299999);
    
TextDrawColor(Ft[playerid], 0xCACA09FF);
    
TextDrawSetOutline(Ft[playerid], 1);
    
TextDrawSetProportional(Ft[playerid], 1);
    
    
SetTimerEx("CheckMoney"2000true"i"playerid);
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    
TextDrawHideForPlayer(playeridFt[playerid]);
    
TextDrawHideForPlayer(playeridBox[playerid]);
    return 
1;
}
forward CheckMoney(playerid);
public 
CheckMoney(playerid)
{
    new 
string[128];
    
    if(
GetPlayerMoney(playerid) < 10)
    {
        
format(stringsizeof(string), "0000000%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
10 <= GetPlayerMoney(playerid) < 100)
    {
        
format(stringsizeof(string), "000000%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
100 <= GetPlayerMoney(playerid) < 1000)
    {
        
format(stringsizeof(string), "00000%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
1000 <= GetPlayerMoney(playerid) < 10000)
    {
        
format(stringsizeof(string), "0000%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
10000 <= GetPlayerMoney(playerid) < 100000)
    {
        
format(stringsizeof(string), "000%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
100000 <= GetPlayerMoney(playerid) < 1000000)
    {
        
format(stringsizeof(string), "00%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
1000000 <= GetPlayerMoney(playerid) < 10000000)
    {
        
format(stringsizeof(string), "0%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    if(
10000000 <= GetPlayerMoney(playerid) < 999999999)
    {
        
format(stringsizeof(string), "%iFt"GetPlayerMoney(playerid));
        
TextDrawSetString(Ft[playerid], string);
        
TextDrawShowForPlayer(playeridFt[playerid]);
        
TextDrawShowForPlayer(playeridBox[playerid]);
    }
    return 
1;

I found this on a webpage, try this!

Edit : This is a filterscript!


Re: Money textdraw? - Shadoww5 - 06.07.2011

You can simplify the callback CheckMoney thus:

PHP код:
public CheckMoney(playerid)
{
    new 
string[128];
    
format(stringsizeof(string), "%08dFt"GetPlayerMoney(playerid));
    
TextDrawSetString(Ft[playerid], string);
    
TextDrawShowForPlayer(playeridFt[playerid]);
    
TextDrawShowForPlayer(playeridBox[playerid]);
    return 
1;

#DOUBT

Is it correct to use thus in this sentence?


Re: Money textdraw? - Outcast - 06.07.2011

I managed to do it on my own, I just added "," and "00" after the original gta money textdraw.


Re: Money textdraw? - Shadoww5 - 06.07.2011

Quote:
Originally Posted by Outcast
Посмотреть сообщение
Also, what is the HEX code of the GTA:SA money font color? Thanks.
Hex: 4B7F41