SA-MP Forums Archive
simple show player money with textdraw will show player money to all !!!!LOL - 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)
+--- Thread: simple show player money with textdraw will show player money to all !!!!LOL (/showthread.php?tid=427715)



simple show player money with textdraw will show player money to all !!!!LOL - dash5487 - 02.04.2013

if player A using showcash cmd to see his money (textdraw is visible to him )and if player B press showcash
then in player A screen will show player B's money

how to fix it ?
new Text:invtextdraw2;
this is under gamemodeinit

Код:
invtextdraw2 = TextDrawCreate(68.750000, 
TextDrawLetterSize(invtextdraw2, 0.234374
TextDrawAlignment(invtextdraw2, 1);      
TextDrawColor(invtextdraw2, -1);         
TextDrawSetShadow(invtextdraw2, 0);      
TextDrawSetOutline(invtextdraw2, 1);     
TextDrawBackgroundColor(invtextdraw2, 51)
TextDrawFont(invtextdraw2, 1);           
TextDrawSetProportional(invtextdraw2, 1);
on command text

PHP код:
dcmd_showcash(playerid,pa
{                     
    
#pragma unused params
new string[128];
format(string,sizeof(string),"~w~cash : ~g~%d $",GetPlayerMoney(playerid));
 
TextDrawShowForPlayer(playerid,invtextdraw2);   
 
TextDrawSetString(invtextdraw2,string); 



Re: simple show player money with textdraw will show player money to all !!!!LOL - DiGiTaL_AnGeL - 02.04.2013

Use playertextdraws.


Re: simple show player money with textdraw will show player money to all !!!!LOL - dash5487 - 02.04.2013

wat ?!


Re: simple show player money with textdraw will show player money to all !!!!LOL - faff - 02.04.2013

Make sure, To add the Textdraws info on ''OnplayerConnect'' Instead of ''Ongamemodeinit''


AW: simple show player money with textdraw will show player money to all !!!!LOL - [AK]Nazgul - 02.04.2013

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw


Re: simple show player money with textdraw will show player money to all !!!!LOL - dash5487 - 02.04.2013

[AK]Nazgul thanks its worked but i have a problem at this

Код:
TextDrawSetString(invtextdraw2[playerid],string);
error
Код:
tag mismatch



Re: simple show player money with textdraw will show player money to all !!!!LOL - L.Hudson - 02.04.2013

faff what you said it useless.

Also try putting a [MAX_PLAYERS] meaning the [playerid] at the textdraw.

pawn Код:
new Text:invtextdraw2[MAX_PLAYERS]; // Top of your script under the includes
pawn Код:
invtextdraw2[playerid] = TextDrawCreate(68.750000,
TextDrawLetterSize(invtextdraw2[playerid] , 0.234374
TextDrawAlignment(invtextdraw2[playerid] , 1);      
TextDrawColor(invtextdraw2[playerid] , -1);        
TextDrawSetShadow(invtextdraw2[playerid] , 0);      
TextDrawSetOutline(invtextdraw2[playerid] , 1);    
TextDrawBackgroundColor(invtextdraw2[playerid] , 51)
TextDrawFont(invtextdraw2[playerid] , 1);          
TextDrawSetProportional(invtextdraw2[playerid] , 1); // In OnPlayerConnect



Re: simple show player money with textdraw will show player money to all !!!!LOL - Private200 - 02.04.2013

pawn Код:
// On the command
TextDrawSetString(invtextdraw2,string);
pawn Код:
// On Player Connect
invtextdraw2[playerid] = TextDrawCreate(68.750000,
TextDrawLetterSize(invtextdraw2[playerid] , 0.234374
TextDrawAlignment(invtextdraw2[playerid] , 1);      
TextDrawColor(invtextdraw2[playerid] , -1);        
TextDrawSetShadow(invtextdraw2[playerid] , 0);      
TextDrawSetOutline(invtextdraw2[playerid] , 1);    
TextDrawBackgroundColor(invtextdraw2[playerid] , 51)
TextDrawFont(invtextdraw2[playerid] , 1);          
TextDrawSetProportional(invtextdraw2[playerid] , 1);
pawn Код:
// Top of script
new Text:invtextdraw2[MAX_PLAYERS];
As Hudson said. "[playerid]" is not used in the TextDrawSetString, that's why it shows that error.


Re: simple show player money with textdraw will show player money to all !!!!LOL - dash5487 - 02.04.2013

Private200
L.Hudson
thanks its worked just fine
im going to sleep now


Re: simple show player money with textdraw will show player money to all !!!!LOL - shadowstorm - 15.04.2015

Use it for individual not global PlayerTextdrawCreate();