SA-MP Forums Archive
TextdrawString - 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: TextdrawString (/showthread.php?tid=212081)



TextdrawString - BlackWolf120 - 16.01.2011

hi,
as soon as a player picks up a pickup i want that the texdraw number decreases from 5 to 4.
If its picked up again from 4 to 3 and so on.
Ive done it like this but it doesnt work.
Do i have to check each texdraw with a timer to get this to work?

pawn Код:
new mrmoneybundlesavailable = 5;

mravspec2 = TextDrawCreate(4.000000, 158.000000, "Money Bundles: ~r~5");
TextDrawBackgroundColor(mravspec2, 255);
TextDrawFont(mravspec2, 1);
TextDrawLetterSize(mravspec2, 0.260000, 0.899999);
TextDrawColor(mravspec2, -1);
TextDrawSetOutline(mravspec2, 1);
TextDrawSetProportional(mravspec2, 1);

PickUpMoneyBundleOnMr = CreatePickup(1212,3,x,y,z,0);

//As soon as the moneyrush begins the textdraw srting is shown
new textformat[185];
format(textformat,sizeof textformat,"Money Bundles: ~r~%d",mrmoneybundlesavailable);
TextDrawSetString(mravspec2,textformat);
TextDrawShowForAll(mravspec2);


//OnPlayerPickUpPickUp
if(pickupid==PickUpMoneyBundleOnMr)
{
mrmoneybundlesavailable --;
}
regards...


Re: TextdrawString - Franck_ - 16.01.2011

Set the TextDrawString After The integral. Like:
pawn Код:
if(pickupid==PickUpMoneyBundleOnMr)
{
     mrmoneybundlesavailable --;
}
new textformat[185];
format(textformat,sizeof textformat,"Money Bundles: ~r~%d",mrmoneybundlesavailable);
TextDrawSetString(mravspec2,textformat);
TextDrawShowForAll(mravspec2);



Re: TextdrawString - Mike_Peterson - 16.01.2011

as im not fully 100% understanding the script ill just say it this wise.
OnPlayerPickup. you will do -- on mrmoneybundlesavailable thats correct. but also update your textdraw there.
So after u did: mrmoneybundlesavailable --; update your textdraw. then it will set to 4 or 3 or 2 or 1. (Minus 1)

EDIT: Franck was earlier... btw doesnt it has to be this:
pawn Код:
if(pickupid==PickUpMoneyBundleOnMr)
{
mrmoneybundlesavailable --;
new textformat[185];
format(textformat,sizeof textformat,"Money Bundles: ~r~%d",mrmoneybundlesavailable);
TextDrawSetString(mravspec2,textformat);
TextDrawShowForAll(mravspec2);
}



Re: TextdrawString - BlackWolf120 - 16.01.2011

thank u it works