simple show player money with textdraw will show player money to all !!!!LOL
#1

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); 
Reply
#2

Use playertextdraws.
Reply
#3

wat ?!
Reply
#4

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

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
Reply
#6

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

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

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
Reply
#8

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.
Reply
#9

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

Use it for individual not global PlayerTextdrawCreate();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)