Taxi Fare gametext - 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: Taxi Fare gametext (
/showthread.php?tid=118859)
Taxi Fare gametext -
Naruto4 - 05.01.2010
i tried to make a gametext that will show money deacreasing while sitting in a taxi.
i made this but it fails and i added a timer
Код:
public FareAmmount(playerid)
{
if(AccountInfo[playerid][Job] != 1)
{
new fare = TaxiFare[playerid];
new ammount = fare*2;
new string[64];
GivePlayerMoney(playerid,-fare);
format(string,64,"%d/sec~n~%d",fare,ammount);
GameTextForPlayer(playerid,string,999,4);
}
else return 1;
return 1;
}
timer is under "onplayerstatechange"
Код:
if(IsATaxi(vehicleid) && PLAYER_STATE_PASSENGER)
{
SetTimer("FareAmmount",1000,1);
}
Re: Taxi Fare gametext -
MadeMan - 05.01.2010
Try this one:
pawn Код:
if(IsATaxi(vehicleid) && newstate == PLAYER_STATE_PASSENGER)
{
SetTimerEx("FareAmmount",1000,1,"i",playerid);
}
Re: Taxi Fare gametext -
Naruto4 - 05.01.2010
the gametext works but the "ammount" is wrong.I dont know how to set it that it will change every second.Bcz the fare like for example $2/sec , that means 1 second it is $2 but the 2 second it is 4$. Fare*seconds.How to set those seconds so they will increase.Thanks
Re: Taxi Fare gametext -
Naruto4 - 06.01.2010
bump ? you understand what i want ?
Re: Taxi Fare gametext -
adsy - 06.01.2010
are you wanting the fare to double every second or do you want to add $2 every second?
Re: Taxi Fare gametext -
Deat_Itself - 06.01.2010
Quote:
Originally Posted by Naruto4
bump ? you understand what i want ?
|
pawn Код:
SetTimerEx("FareAmmount",1000,1,"i",playerid); //1 it will repeat again and again if the player is in taxi.
So if someone is in taxi it will repeat it again and again it will -2 dollars on every second.
Re: Taxi Fare gametext -
GTAguillaume - 06.01.2010
Put this on the top of your script:
Код:
new totaltaxiamount[MAX_PLAYERS]
or put it in enum
then:
Код:
public FareAmmount(playerid)
{
if(AccountInfo[playerid][Job] != 1)
{
new fare = TaxiFare[playerid];
new ammount = fare*2;
totaltaxiamount[playerid] += ammount;
//or AccountInfo[playerid][totaltaxiamount] += ammount;
new string[64];
GivePlayerMoney(playerid,-fare);
format(string,64,"%d/sec~n~%d",fare,totaltaxiamount[playerid]);
GameTextForPlayer(playerid,string,999,4);
}
else return 1;
return 1;
}
Re: Taxi Fare gametext -
Naruto4 - 06.01.2010
nice idea.thx