SA-MP Forums Archive
Scripting Help (Taxi) For A RPG Server - 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: Scripting Help (Taxi) For A RPG Server (/showthread.php?tid=388117)



Scripting Help (Taxi) For A RPG Server - Sufrdude099 - 27.10.2012

Hi all.
So I download Stevo127's San Fierro Cops And Robbers Gamemode, and I decided to edit a few parts of the script.
So far, everything has gone well. but now I have reached a bit of trouble. There is a class in the gamemode which allows you to become a taxi driver. The taxis that are operable (I mean that they actually belong to the taxi company) which pay you when a passenger gets in (obviously) are limited. What I mean by this is that only certain taxis are actually owned by the company. Even though you are a driver, only those taxis are usable for your skill. The others are for personal use. So I decided to add this small code into the gamemode.

Код:
GetPlayerVehicleID(playerid) == 420
So now it looks like this

Код:
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    if(GetPlayerVehicleID(playerid) == TaxiVehicle1 || GetPlayerVehicleID(playerid) == TaxiVehicle2 ||
	    GetPlayerVehicleID(playerid) == TaxiVehicle3 || GetPlayerVehicleID(playerid) == TaxiVehicle4 ||
	    GetPlayerVehicleID(playerid) == TaxiVehicle5 || GetPlayerVehicleID(playerid) == TaxiVehicle6 ||
	    GetPlayerVehicleID(playerid) == TaxiVehicle7 || GetPlayerVehicleID(playerid) == TaxiVehicle8 ||
	    GetPlayerVehicleID(playerid) == TaxiVehicle9 || GetPlayerVehicleID(playerid) == TaxiVehicle10 ||
        GetPlayerVehicleID(playerid) == TaxiVehicle11 || GetPlayerVehicleID(playerid) == TaxiVehicle12 ||
        GetPlayerVehicleID(playerid) == TaxiVehicle13 || GetPlayerVehicleID(playerid) == TaxiVehicle14 ||
		GetPlayerVehicleID(playerid) == 420)
        {
	        if(gTeam[playerid] == TEAM_DRIVER && GetPlayerWantedLevel(playerid) == 0)
	        {
	            SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Taxi Vehicle_]]");
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Taxi Company vehicle.");
	            OnDuty[playerid] =1;

	            format(string,sizeof(string),"[TAXI DUTY] %s(%d) is now on taxi duty. Call them with /taxi to get picked up at your location.",PlayerName(playerid),playerid);
	            SendClientMessageToAll(COLOR_DARKOLIVEGREEN,string);

	            format(string,sizeof(string),"3[TAXI DUTY] %s(%d) is now on taxi duty. Call them with /taxi to get picked up at your location.",PlayerName(playerid),playerid);
				IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
				return 1;
			}
		}
	}
But it doesn't work. I used 420 as it is the vehicle id for taxis.
I have attached the gamemode script as well. PLEASE HELP ME!!!!!

P.S. While writing this thread I realised I was asking for the id of the vehicle instead of the model. I still need help though!!!!


Re: Scripting Help (Taxi) For A RPG Server - GaB1TzZzu - 27.10.2012

Use GetVehicleModel(GetPlayerVehicleID(playerid) . Which errors show?


Re: Scripting Help (Taxi) For A RPG Server - Sufrdude099 - 29.10.2012

Ok. I'll try that. The thing is that the script compiles. I have compiled the script with your code added. Thank you. I won't be able to reply ASAP as I doing a clean install of GTA SA right now.


Re: Scripting Help (Taxi) For A RPG Server - Sufrdude099 - 29.10.2012

YOU ARE A HERO. THANK YOU SO MUCH. IT WORKS!!!! +REPED!!!!