[HELP] Is this possible?
#1

Hey,

Is it possible to disable engine and exhaust, the sound and stuff,
So i can put in a full vehicle FS.

Greetz
Reply
#2

Someone?
Reply
#3

pawn Код:
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new engine,lights,alarm,doors,bonnet,boot,objective;

if(strcmp(cmd, "/engineon",true) == 0)
{
    new veiculoid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid)) {
        GetVehicleParamsEx(veiculoid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_ON) {
            SendClientMessage(playerid,0x800000AA,"engine is on");
            return 1;
        }
        else {
            SetVehicleParamsEx(veiculoid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
            SendClientMessage(playerid,0x008040AA," engine on");
        }
    }
    else {
    SendClientMessage(playerid,0x800000AA," you're not in a vehicle");
    }
    return 1;
}


if(strcmp(cmd, "/engineoff",true) == 0)
{
    new veiculoid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid)) {
        GetVehicleParamsEx(veiculoid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_OFF) {
            SendClientMessage(playerid,0x800000AA," engine is already off");
            return 1;
        }
        else {
            SetVehicleParamsEx(veiculoid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
            SendClientMessage(playerid,0x008040AA," engine off");
        }
    }
    else {
    SendClientMessage(playerid,0x800000AA," you're not inside a vehicle");
    }
    return 1;
}
Reply
#4

GetPlayerVehicleID(playerid) returns zero if the player isn't in a vehicle.

pawn Код:
new veiculoid = GetPlayerVehicleID(playerid);
   
if(IsPlayerInAnyVehicle(playerid))
Could be

pawn Код:
new veiculoid = GetPlayerVehicleID(playerid);

if(veiculoid)
Not much of an improvement, but still...
Reply
#5

I mean, just if you enter a vehicle nothing happends that you can't drive that you can nothing, NOT freeze or something
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)