SA-MP Forums Archive
Need help with taxi! - 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: Need help with taxi! (/showthread.php?tid=81616)



Need help with taxi! - Intent - 12.06.2009

I am using Los Angeles GM and there is a bug with taxi. When a player exits the taxi after he has reached his destionation player loses some money but the taxi driver is not getting any money. I remember that in the Los Angeles topic there was a fix posted but now the topic is deleted.

Here is the lines that are for taxi(i think):
Код:
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
	{
	  if(IsPlayerConnected(TransportDriver[playerid]))
		{
		  new string[64];
		  TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
		  TransportTime[TransportDriver[playerid]] = 0;
		  TransportCost[TransportDriver[playerid]] = 0;
		  format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
		  GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
Код:
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
		{
		  if(IsPlayerConnected(TransportDriver[playerid]))
			{
			  TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
			  TransportTime[TransportDriver[playerid]] = 0;
			  TransportCost[TransportDriver[playerid]] = 0;
			  format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
			  GameTextForPlayer(playerid, string, 5000, 1);
			  format(string, sizeof(string), "~w~Passenger left the taxi~n~~g~Earned $%d",TransportCost[playerid]);
			  GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
				GivePlayerCash(playerid, -TransportCost[playerid]);
				TransportCost[playerid] = 0;
				TransportTime[playerid] = 0;
				TransportDriver[playerid] = 999;
			}
		}
		TelePos[playerid][0] = 0.0;
		TelePos[playerid][1] = 0.0;
	}
	if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
	{
	  new name[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, name, sizeof(name));
	  new vehicleid = GetPlayerVehicleID(playerid);
	  for(new i = 0; i < MAX_PLAYERS; i++)
	  {
	    if(IsPlayerConnected(i))
	    {
	      if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
	      {
	        if(GetPlayerCash(playerid) < TransportValue[i])
	        {
	          format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
						SendClientMessage(playerid, COLOR_WHITE, string);
						RemovePlayerFromVehicle(playerid);
	        }
	        else
	        {
	          if(TransportDuty[i] == 1)
	          {
	            format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
							SendClientMessage(playerid, COLOR_WHITE, string);
							format(string, sizeof(string), "* Passenger %s has entered your Taxi.", name);
							SendClientMessage(i, COLOR_WHITE, string);
							TransportTime[i] = 1;
	          	TransportTime[playerid] = 1;
	          	TransportCost[playerid] = TransportValue[i];
	          	TransportCost[i] = TransportValue[i];
	          	TransportDriver[playerid] = i;
	          }
	          else if(TransportDuty[i] == 2)
	          {
	            format(string, sizeof(string), "* You paid $%d to the Bus Driver.", TransportValue[i]);
							SendClientMessage(playerid, COLOR_WHITE, string);
							format(string, sizeof(string), "* Passenger %s has entered your Bus.", name);
							SendClientMessage(i, COLOR_WHITE, string);
	          }
						GivePlayerCash(playerid, - TransportValue[i]);
						TransportMoney[i] += TransportValue[i];
	        }
	      }
	    }
	  }
	}



Re: Need help with taxi! - Intent - 12.06.2009

bump


Re: Need help with taxi! - Intent - 13.06.2009

bump


Re: Need help with taxi! - Abernethy - 13.06.2009

Quote:
Originally Posted by Intent
bump
Stop bumping + Triple posting please.


Re: Need help with taxi! - Intent - 13.06.2009

And how did that line help me? Next time you should post something that will help.