TextdrawString
#1

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

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

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

thank u it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)