/engine rented
#1

I have that script in my gamemode
https://sampforum.blast.hk/showthread.php?tid=252231
My engine command is :
Код:
		if(!strcmp(cmd, "/engine", true))
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsPlayerInAnyVehicle(playerid))
			{
			    if(!IsPlayerInAnyVehicle(playerid))
				{
					SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !");
					return 1;
				}
				if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_GRAD2, "Only the driver can do this!");
			    if(IsAPublicCar(idcar))/*
		   		{
 		   	 		SendClientMessage(playerid, COLOR_GREY, "You don't have the keys to this vehicle.");
	   				return 1;
		   		}*/
		   		
			    if(IsADmv(idcar) || IsAHarvest(idcar) || IsADrugHarvest(idcar) || IsASweeper(idcar) || pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
					return 1;
					
	        	if(Gas[idcar] == 0)
	        	    return SendClientMessage(playerid,COLOR_GREY,"   No fuel in this vehicle! Call a Mechanic (555)!");
	        	    
	        /*	new	vID = GetPlayerVehicleID(playerid);
	        	if (GetPVarInt(playerid, "Renting") == 0 || !IsRentedCar(vID) || IsRentableCar(vID))
	        	    return SendClientMessage(playerid,COLOR_GREY,"   You can't start the car you are not rented");*/

                if(dying[playerid] == 1)
                    return SendClientMessage(playerid,COLOR_GREY,"   Do not Bug Abuse!");
	    		if(!engineOn[idcar])
					{
 				       if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
						{
    						new playerveh = GetPlayerVehicleID(playerid);
					    	engineOn[idcar] = true;
					    	PutPlayerInVehicle(playerid, playerveh, 0);
					    	TogglePlayerControllable(playerid,1);
			    			GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
							bootopen = 0;
							bonnetopen = 0;
							alarmon = 0;
							lightson = 0;
					    	format(string, sizeof(string), "* %s spins the key and starts vehicle's engine.", sendername);
					    	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							return 1;
						}
						return 1;
					}
					else if(engineOn[idcar])
	    			{
	        			if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
						{
					    	engineOn[idcar] = false;
        			 		GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
							SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
							bootopen = 0;
							bonnetopen = 0;
							alarmon = 0;
							lightson = 0;
					    	TogglePlayerControllable(playerid, 0);
					    	format(string, sizeof(string), "* %s spins the key and turns off the vehicle's engine.", sendername);
					    	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							return 1;
						}
						return 1;
					}
				}
	    	}
	    	return 1;
		}
The if doesnt working
Код:
	        	new	vID = GetPlayerVehicleID(playerid);
	        	if (GetPVarInt(playerid, "Renting") == 0 || !IsRentedCar(vID) || IsRentableCar(vID))
	        	    return SendClientMessage(playerid,COLOR_GREY,"   You can't start the car you are not rented");
How I can do if its rented car and you dont you are dont own this car
or its not rented car but its rentable you cant start the engine
Or if the car Is not rented by me and its rentablecar you cant start the engine
Something like that
Thanks!
Reply
#2

BUMP
Reply
#3

BUMP
Reply
#4

BUMP
Reply
#5

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)