Car command help
#1

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;
	}
Reply
#2

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

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

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().
Reply
#5

Anyone else want to have a look
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)