Jump to content
  • 0

/engine si /light


gabbii

Question

cum as putea sa fac /engine sa aprind motorul si sa il sting tot cu /engine, as mai vrea sa scot cand aprind motorul pe tasta 2 si la lumini sa le aprind pe litera L si sa le sting tot pe litera L?

	}
    if(strcmp(cmd, "/engine",true) == 0) {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID) {
            if(IsABBike(vid)) return SendClientMessage(playerid, COLOR_GRAD2, "This bike doesen't have engine!");
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
//                                 ||||||
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
//VEHICLE_PARAMS_ON is used to start the engine,it purely replace the engine thing!
        }
        return 1;
    }
    if(strcmp(cmd, "/stopengine",true) == 0) {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID) {
            if(IsABBike(vid)) return SendClientMessage(playerid, COLOR_GRAD2, "This bike doesen't have engine!");
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
//                                 ||||||
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
//Here the VEHICLE_PARAMS_OFF will turn off your engine.
        }
        return 1;
    }
    if(strcmp(cmd, "/lightson",true) == 0) {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID) {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
//                                        ||||||
            SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
//VEHICLE_PARAMS_ON is used to turn onn the lights.
        }
        return 1;
    }
    if(strcmp(cmd, "/lightsoff",true) == 0) {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID) {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
//                                        ||||||
            SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
//Here the VEHICLE_PARAMS_OFF will turn off your lights.
        }
        return 1;
    }

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.