0.3c Vehicle System Help
#1

I have read multiple tutorials on how to do this, I do not understand can someone explain How I can create such things like:

/engineon
/eoff
/lon (Lights)
/loff
/trunk
/bonnet


Can someone help me please?

Also the script I use does not have OnPlayerCommandText.
Reply
#2

listen before you do this commedns you need to define first

and about this commedns type


PHP код:
public OnPlayerCommandText(...)
{
    if(
strcmp(cmd"/the commend",true) == 0

then type your commmend in /thecommend place and do your magic

if you need anyhelp in scripting just PM me
Reply
#3

pawn Код:
new EngineStatus[MAX_VEHICLES];

COMMAND:engine(playerid, params[]) {
    new vehid, lights, alarm, doors, bonnet, boot, objective;
    if(IsPlayerInAnyVehicle(playerid)) {
        vehid = GetPlayerVehicleID(playerid);
        if(EngineStatus[vehid] == 0) {
            SetVehicleParamsEx(vehid, 1, lights, alarm, doors, bonnet, boot, objective);
            //TogglePlayerControllable(playerid, 1);
            EngineStatus[vehid] = 1;
            SendRadiusMessage(playerid, 15, "turns on the engine of the vehicle.");
        }
        else if(EngineStatus[vehid] == 1) {
            SetVehicleParamsEx(vehid, 0, lights, alarm, doors, bonnet, boot, objective);
            //TogglePlayerControllable(playerid, 0);
            EngineStatus[vehid] = 0;
            SendRadiusMessage(playerid, 15, "turns off the engine of the vehicle.");
        }
    }
    else return ErrorMessage(playerid, "You must be in a vehicle to use that command!");
    return 1;
}
That's a simple /engine command, of course, you're going to have to modify the command because it has some of my custom stocks in there, but they're only messages.
Reply
#4

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)