14.03.2010, 23:37
This is my code now and i have the game text comming up for the passenger but not for the taxi driver also its taking 2 dollers a second from the passenger but not giving it to the driver .And the game tex is staying at 0seconds 0dollars
if(newstate==PLAYER_STATE_PASSENGER)
{
new VID=GetPlayerVehicleID(playerid);
if(GetVehicleModel(VID) == 420)
{
SetTimerEx("FareAmmount",1000,1,"i",playerid);
}
}
public FareAmmount(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
new fare = TaxiFare[playerid];
new ammount = fare*2;
totaltaxiamount[playerid] += ammount;
new string[64];
GivePlayerMoney(playerid, -2);
format(string,64,"%d/sec~n~%d",fare, totaltaxiamount[playerid]);
GameTextForPlayer(playerid,string,999,4);
}
if(gTeam[playerid] == TEAM_TAXI)
{
new fare = TaxiFare[playerid];
new ammount = fare*2;
totaltaxiamount[playerid] += ammount;
new string[64];
GivePlayerMoney(playerid, 2);
format(string,64,"%d/sec~n~%d",fare, totaltaxiamount[playerid]);
GameTextForPlayer(playerid,string,999,4);
return 1;
}
return 1;
}
if(newstate==PLAYER_STATE_PASSENGER)
{
new VID=GetPlayerVehicleID(playerid);
if(GetVehicleModel(VID) == 420)
{
SetTimerEx("FareAmmount",1000,1,"i",playerid);
}
}
public FareAmmount(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
new fare = TaxiFare[playerid];
new ammount = fare*2;
totaltaxiamount[playerid] += ammount;
new string[64];
GivePlayerMoney(playerid, -2);
format(string,64,"%d/sec~n~%d",fare, totaltaxiamount[playerid]);
GameTextForPlayer(playerid,string,999,4);
}
if(gTeam[playerid] == TEAM_TAXI)
{
new fare = TaxiFare[playerid];
new ammount = fare*2;
totaltaxiamount[playerid] += ammount;
new string[64];
GivePlayerMoney(playerid, 2);
format(string,64,"%d/sec~n~%d",fare, totaltaxiamount[playerid]);
GameTextForPlayer(playerid,string,999,4);
return 1;
}
return 1;
}