variable left
#1

So i have a script, when you type /buy, it does this:
pawn Код:
PInfo[playerid][boughtcars]++;
. There's nothing wrong about that but i want it to say how much you have left when you respawn.
Here it goes wrong:
i tried these codes:
pawn Код:
cars = PInfo[playerid][boughtcars]--;
cars = (PInfo[playerid][boughtcars] - 1);
cars = PInfo[playerid][boughtcars] - 1;
It needs to say in a sendclientmessage: "You still have %s cars left!", i only need to know how to get it.
None of them realy worked, the second one gave weird letters like й in the string.
Could you guys help me? Thnx.
---Edit---
I also have (string shadows a variable on a preceding level.).
I think i already got the first question but how do i solve this one?
Reply
#2

Quote:
Originally Posted by mitchboy
Посмотреть сообщение
So i have a script, when you type /buy, it does this:
pawn Код:
PInfo[playerid][boughtcars]++;
. There's nothing wrong about that but i want it to say how much you have left when you respawn.
Here it goes wrong:
i tried these codes:
pawn Код:
cars = PInfo[playerid][boughtcars]--;
cars = (PInfo[playerid][boughtcars] - 1);
cars = PInfo[playerid][boughtcars] - 1;
It needs to say in a sendclientmessage: "You still have %s cars left!", i only need to know how to get it.
None of them realy worked, the second one gave weird letters like й in the string.
Could you guys help me? Thnx.
---Edit---
I also have (string shadows a variable on a preceding level.).
I think i already got the first question but how do i solve this one?
Dude, try to explain more better..

You could just use a new variable like the following for counting the cars one have:-

pawn Код:
new count[MAXPLAYERS]; // top

//When he buy the car or gets it you add the following to start counting:-

count[playerid]++; // maybe in a command which is use to buy cars.

// and following for minus the car which is sold/destroyed/gone:-

count[playerid]--; // this decrease the amount car by 1 digit everytime when one loses the car.
is this is what uou mean then probably i have helped you, if not then explain better.

-FalconX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)