/motoron = bicycle
#1

Hello. I have /motoron in my GameMode, but how can i make when i sit on bicycle /motoron dont appear. So i dont have to turn on the bicycle :P And how can i disable " FUEL: % " on Bicycle too.
Reply
#2

What's /motoron?
Put inside the command.
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid))==510||GetVehicleModel(GetPlayerVehicleID(playerid))==509||GetVehicleModel(GetPlayerVehicleID(playerid))==481) return 1;
510 509 and 481 are bicycles.
Reply
#3

You can use the same code in the function that displays the "FUEL %" string. Maybe you should do that to on parts of your script where the amount of fuel is decreased.
Reply
#4

Quote:
Originally Posted by MenaceX^
What's /motoron?
Put inside the command.
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid))==510||GetVehicleModel(GetPlayerVehicleID(playerid))==509||GetVehicleModel(GetPlayerVehicleID(playerid))==481) return 1;
510 509 and 481 are bicycles.
I tryed but it's still not working.

Picture of problem:


Code:
Код:
	if(!strcmp(cmd, "/motoron", true))
	{
	  new vehid = GetPlayerVehicleID(playerid);
		if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_GRAD1, "Motor je vec upaljen!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "Niste u vozilu!");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_GRAD1, "Samo vozac moze upaliti vozilo!");
		if((PlayerInfo[playerid][pDonateRank] != 2) && (vehid >= 140 && vehid <= 143)) return 0;
		if(GetVehicleModel(GetPlayerVehicleID(playerid))==161||GetVehicleModel(GetPlayerVehicleID(playerid))==162) return 1;
		if(GetVehicleModel(GetPlayerVehicleID(playerid))==163||GetVehicleModel(GetPlayerVehicleID(playerid))==164) return 1;
		if(GetVehicleModel(GetPlayerVehicleID(playerid))==165) return 1;
    new rand = random(100);
    if(rand >= 0 && rand <= 75)
    {
			engineOn[GetPlayerVehicleID(playerid)] = true;
			TogglePlayerControllable(playerid, true);
			new playerveh = GetPlayerVehicleID(playerid);
			PutPlayerInVehicle(playerid, playerveh, 0);
			SendClientMessage(playerid, COLOR_GREEN, "Motor je upaljen!");
			SendClientMessage(playerid, COLOR_LIGHTRED, "Da bi ste ugasili motor upisite /motoroff");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s je upalio motor.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			return true;
		}
		else {
			SendClientMessage(playerid, COLOR_LIGHTRED, "Niste uspjeli upaliti motor, pokusajte ponovo.");
			TogglePlayerControllable(playerid, false);
			return 1;
		}

	}
	if(!strcmp(cmd, "/motoroff", true))
	{
	  new vehid = GetPlayerVehicleID(playerid);
		if(!engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_GRAD1, "Motor nije upaljen!");
		if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "Niste u vozilu!");
		if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_GRAD1, "Samo vozac moze upaliti vozilo!");
    if((PlayerInfo[playerid][pDonateRank] != 2) && (vehid >= 140 && vehid <= 143)) return 0;
		engineOn[GetPlayerVehicleID(playerid)] = false;
		TogglePlayerControllable(playerid, false);
		SendClientMessage(playerid, COLOR_RED, "Motor je ugasen!");
 		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "* %s je ugasio motor.", sendername);
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		return true;
	}
Reply
#5

It cannot work because you are using the vehicleid, not the modelid!
Reply
#6

Quote:
Originally Posted by breadfish
It cannot work because you are using the vehicleid, not the modelid!

Please explain a lil better pls, im not a PRO rofl :P
Reply
#7

Please someone help, thank you!
Reply
#8

Zdravo. I believe you need to change the 161 and all of that to the IDs of the bikes.
Reply
#9

I did but still not working :P
Reply
#10

You need also do that in function displaying that message returning 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)