Jump to content

Cum pot face sa pornesc masina pe tasta 2


KoKo

Recommended Posts

Salut doresc sa pot scrie si /engine dar sa pot apasa pe tasta 2 in acelasi timp ca sa pornesc masina.

YCMD:engine(playerid, params[], help) 
{
	if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not driving a vehicle.");
	new string[128];			
	new vehid = GetPlayerVehicleID(playerid);
	if(IsABike(vehid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You can't turn on engine on a bike!");
	if(Gas[vehid] == ) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: This vehicle doesn't have fuel.");
	new e,l,a,d,b,bo,o;
	GetVehicleParamsEx(vehid,e,l,a,d,b,bo,o);
	new name[25];
	GetPlayerName(playerid, name, sizeof(name));
	if(e == )
	{
		SetVehicleParamsEx(vehid,1,l,a,d,b,bo,o);
		format(string, sizeof(string), "* %s starts the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	}
	else
	{
	    SetVehicleParamsEx(vehid,,l,a,d,b,bo,o);
		format(string, sizeof(string), "* %s stops the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	}
	return 1;
}

 

Edited by KoKo
Link to comment
Share on other sites

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if((newkeys == KEY_SUBMISSION))
	{
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not driving a vehicle.");
		new string[128];			
		new vehid = GetPlayerVehicleID(playerid);
		if(IsABike(vehid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You can't turn on engine on a bike!");
		if(Gas[vehid] == ) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: This vehicle doesn't have fuel.");
		new e,l,a,d,b,bo,o;
		GetVehicleParamsEx(vehid,e,l,a,d,b,bo,o);
		new name[25];
		GetPlayerName(playerid, name, sizeof(name));
		if(e == )
		{
			SetVehicleParamsEx(vehid,1,l,a,d,b,bo,o);
			format(string, sizeof(string), "* %s starts the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SetVehicleParamsEx(vehid,,l,a,d,b,bo,o);
			format(string, sizeof(string), "* %s stops the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		return 1;	
	}
	return 1;
}

 

Link to comment
Share on other sites

10 minutes ago, PunkyRO said:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if((newkeys == KEY_SUBMISSION))
	{
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not driving a vehicle.");
		new string[128];			
		new vehid = GetPlayerVehicleID(playerid);
		if(IsABike(vehid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You can't turn on engine on a bike!");
		if(Gas[vehid] == ) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: This vehicle doesn't have fuel.");
		new e,l,a,d,b,bo,o;
		GetVehicleParamsEx(vehid,e,l,a,d,b,bo,o);
		new name[25];
		GetPlayerName(playerid, name, sizeof(name));
		if(e == )
		{
			SetVehicleParamsEx(vehid,1,l,a,d,b,bo,o);
			format(string, sizeof(string), "* %s starts the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SetVehicleParamsEx(vehid,,l,a,d,b,bo,o);
			format(string, sizeof(string), "* %s stops the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		return 1;	
	}
	return 1;
}

 

Am mai multe la 

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

unde trebuie sa o pun?Prima

Link to comment
Share on other sites

La 30.03.2016 la 19:22, KoKo a spus:

Am mai multe la 


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

unde trebuie sa o pun?Prima

Vezi sa nu ai de doua ori KEY_SUBMISSION - daca nu ai de duci inainte de alta functie si pui doar ce e aici .

	if((newkeys == KEY_SUBMISSION))
	{
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not driving a vehicle.");
		new string[128];			
		new vehid = GetPlayerVehicleID(playerid);
		if(IsABike(vehid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You can't turn on engine on a bike!");
		if(Gas[vehid] == ) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: This vehicle doesn't have fuel.");
		new e,l,a,d,b,bo,o;
		GetVehicleParamsEx(vehid,e,l,a,d,b,bo,o);
		new name[25];
		GetPlayerName(playerid, name, sizeof(name));
		if(e == )
		{
			SetVehicleParamsEx(vehid,1,l,a,d,b,bo,o);
			format(string, sizeof(string), "* %s starts the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SetVehicleParamsEx(vehid,,l,a,d,b,bo,o);
			format(string, sizeof(string), "* %s stops the engine of the %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		return 1;	
	}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.