/engine question
#1

Hey.. I'm trying to make that you wont have to type /engine if you drive bicycles... well I tried to make a foward + public of the vehiclemodel but it didnt help.. the last thing I tried is that:


pawn Код:
on:
public OnPlayerStateChange(playerid, newstate, oldstate)

if(GetVehicleModel(newcar) == 481 || GetVehicleModel(newcar) == 509 || GetVehicleModel(newcar) == 510)//BMX
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
            return 1;
        }

and my /engine command:

pawn Код:
if(!strcmp(cmd, "/engine", true))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s puts the keys and turn on the engine.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            if(engine == 1)
            {
                SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s Turn off the engine and take the keys.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
            }
        }
        return 1;
    }
Reply


Messages In This Thread
/engine question - by Qur - 30.11.2011, 03:48
Re: /engine question - by =WoR=Varth - 30.11.2011, 04:47
Re: /engine question - by AstonDA-G - 30.11.2011, 07:18
Re: /engine question - by Qur - 30.11.2011, 14:44
Re: /engine question - by AstonDA-G - 30.11.2011, 14:51
Re: /engine question - by =WoR=Varth - 30.11.2011, 14:52
Re: /engine question - by Qur - 30.11.2011, 14:58
Re: /engine question - by =WoR=Varth - 30.11.2011, 15:13
Re: /engine question - by Qur - 30.11.2011, 15:15
Re: /engine question - by =WoR=Varth - 30.11.2011, 15:18

Forum Jump:


Users browsing this thread: 4 Guest(s)