Turning Of the engine 0.3c
#1

Hey, could someone give me a line that shutdowns the vehicles engine? (0.3c)
Reply
#2

Код:
if(strcmp("/engine", cmdtext, true, 10) == 0)
	{
	    new engine,lights,alarm,doors,bonnet,boot,objective;
	    new veh = GetPlayerVehicleID(playerid);
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(veh != INVALID_VEHICLE_ID)
			{
				if(EngineStatus[playerid] == 0)
				{
					GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {2F991A}on!");
                    return 1;
				}
				else if(EngineStatus[playerid] == 1)
				{
					GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, "You've turned the vehicle's engine {E31919}off!");
					return 1;
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		return 1;
		}
	}
I copy it from my gamemode
Reply
#3

Quote:

SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");

Wow, really? You set the color of the message and then use an embed to change the entire message color?

pawn Код:
//OnPlayerCommandText
    if(!strcmp(cmdtext,"/engine",true))
    {
        if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,0xFF0000FF,"You are not in a vehicle!");
        new engine, lights, alarm, doors, bonnet, boot, objective, vehid=GetPlayerVehicleID(playerid);
        GetVehicleParamsEx(vehid,engine, lights, alarm, doors, bonnet, boot, objective);
        if(!engine)
        {
            SetVehicleParamsEx(vehid,1,lights,alarm,doors,bonnet,boot,objective);
            return SendClientMessage(playerid,0xAAAAAAFF,"Vehicle started!");
        }else{
            SetVehicleParamsEx(vehid,0,lights,alarm,doors,bonnet,boot,objective);
            return SendClientMessage(playerid,0xAAAAAAFF,"Vehicle turned off!");
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)