Scripting Help (Taxi) For A RPG Server
#1

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!!!!
Reply
#2

Use GetVehicleModel(GetPlayerVehicleID(playerid) . Which errors show?
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)