variable left - 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: variable left (
/showthread.php?tid=320837)
variable left -
mitchboy - 24.02.2012
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?
Re: variable left -
FalconX - 25.02.2012
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