SA-MP Forums Archive
Car command help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car command help (/showthread.php?tid=204673)



Car command help - yarrum3 - 30.12.2010

i want the command so you do /carcmd engine and the car with start but right now it will only start with /engine for some reason and when i do other commands in my script it will do this command please help.


Код:
if(!strcmp(cmd,"/carcmd",true))
	{
			SendClientMessage(playerid,WHITE,"USAGE:/car[name]");
			SendClientMessage(playerid,COLOR_GREY,"use:Engine,Lights,Trunk");
	        return 1;
		}
		else if (!strcmp(tmp,"engine",true))
		{
			new vid = GetPlayerVehicleID(playerid);
			if(vid != INVALID_VEHICLE_ID)
			if(carruning == 0)
 			{
 			SendClientMessage(playerid,WHITE,"Vehicle {D10000}Engine starting,please wait.");
	  		SetTimer("enginestart", 4000, 0);// will take 7 sec
			}
			else
			{
	    	carruning = 0;
			GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    		SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    		SendClientMessage(playerid,WHITE,"Vehicle {D10000}Engine stopped");
		}
		return 1;
	}



Re: Car command help - _rAped - 30.12.2010

Quote:
Originally Posted by yarrum3
Посмотреть сообщение
i want the command so you do /carcmd engine and the car with start but right now it will only start with /engine for some reason and when i do other commands in my script it will do this command please help.


Код:
if(!strcmp(cmd,"/carcmd",true))
	{
			SendClientMessage(playerid,WHITE,"USAGE:/car[name]");
			SendClientMessage(playerid,COLOR_GREY,"use:Engine,Lights,Trunk");
	        return 1;
		}
		else if (!strcmp(tmp,"engine",true))
		{
			new vid = GetPlayerVehicleID(playerid);
			if(vid != INVALID_VEHICLE_ID)
			if(carruning == 0)
 			{
 			SendClientMessage(playerid,WHITE,"Vehicle {D10000}Engine starting,please wait.");
	  		SetTimer("enginestart", 4000, 0);// will take 7 sec
			}
			else
			{
	    	carruning = 0;
			GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    		SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    		SendClientMessage(playerid,WHITE,"Vehicle {D10000}Engine stopped");
		}
		return 1;
	}
What the fuck are you talking about? Btw you only turn off the engine. Use:
pawn Код:
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
You also need to define lights on when turning on the engine.


Re: Car command help - yarrum3 - 30.12.2010

Quote:
Originally Posted by _rAped
Посмотреть сообщение
What the fuck are you talking about? Btw you only turn off the engine. Use:
pawn Код:
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
You also need to define lights on when turning on the engine.
read the script i got a timer on it that gose to a call back.

and im just asking how do i make it so i do /carcmd space engine


Re: Car command help - _rAped - 30.12.2010

Quote:
Originally Posted by yarrum3
Посмотреть сообщение
read the script i got a timer on it that gose to a call back.

and im just asking how do i make it so i do /carcmd space engine
Oh. I'm kinda tired, sorry.

Take a look at strtok().


Re: Car command help - yarrum3 - 30.12.2010

Anyone else want to have a look