simple engine command.
#1

I looked everywhere before posting this...
I can't find a simple engine FS where you just type /engine (on) and /engine again (off)
all of them either 1/4 chance of engine failure or hotwire, I dont want any of those..
Just a easy and simple /engine command...
anyone got it?
Reply
#2

pawn Код:
//ongamemodeinit
ManualVehicleEngineAndLights();


CMD:engine(playerid)//or if(!strcmp(cmd, "/engine", true))
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine == 1)
        SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    else SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
Reply
#3

Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(542) : warning 217: loose indentation
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14894) : error 017: undefined symbol "vehicleid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14896) : error 017: undefined symbol "vehicleid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14897) : error 017: undefined symbol "vehicleid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14899) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
//ongamemodeinit
ManualVehicleEngineAndLights();


CMD:engine(playerid)//or if(!strcmp(cmd, "/engine", true))
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine == 1)
        SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    else SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
Hey thanks man.. It helped to me too a lot..
but can you please or someone else just expalin what each of this big mess saying?
thanks


Quote:
Originally Posted by Jordiee
Посмотреть сообщение
Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(542) : warning 217: loose indentation
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14894) : error 017: undefined symbol "vehicleid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14896) : error 017: undefined symbol "vehicleid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14897) : error 017: undefined symbol "vehicleid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14899) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Just do this:

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(engine == 1)
        SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
        else SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
    }
Reply
#5

Im using it in this format CMD:
Reply
#6

pawn Код:
CMD:engine(playerid)
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessae(playerid, -1, "You need to be the driver!");
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine == 1)
        SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
    else SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
}
Reply
#7

Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14893) : error 017: undefined symbol "playreid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14893) : error 017: undefined symbol "SendClientMessae"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14899) : warning 209: function "cmd_engine" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
EDIT: Now I only have the warning
Reply
#8

pawn Код:
//Under  OnGameModeInt
ManualVehicleEngineAndLights();

//at the bottom of ur script
stock VehicleEngine(vehicleid,VAR)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(VAR == 1)
    {
        SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    }else{
        SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    }
}

//and when ever you want to turn on or off the vehicle engine you do
VehicleEngine(vehicleid,true);//This will turn it ON
VehicleEngine(vehicleid,false);//This will turn it OFF
VehicleEngine(vehicleid,toggle);
vehicleid the Vehicle that's engine will be ON/OFF
toggle 0 & false to TURN OFF the engine or 1 & true to TURN ON
Reply
#9

Now I only have the warning :/
Reply
#10

Quote:
Originally Posted by Jordiee
Посмотреть сообщение
Код:
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14893) : error 017: undefined symbol "playreid"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14893) : error 017: undefined symbol "SendClientMessae"
C:\Users\Jordan\Desktop\Windows\gamemodes\vx-rp.pwn(14899) : warning 209: function "cmd_engine" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
EDIT: Now I only have the warning
error 017: undefined symbol "playreid"

lol "playreid" just change it to playerid xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)