[HELP] Is this possible? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Is this possible? (
/showthread.php?tid=347880)
[HELP] Is this possible? -
Stefand - 03.06.2012
Hey,
Is it possible to disable engine and exhaust, the sound and stuff,
So i can put in a full vehicle FS.
Greetz
Re: [HELP] Is this possible? -
Stefand - 03.06.2012
Someone?
Re: [HELP] Is this possible? -
leonardo1434 - 03.06.2012
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;
}
Re: [HELP] Is this possible? -
iggy1 - 03.06.2012
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...
Re: [HELP] Is this possible? -
Stefand - 03.06.2012
I mean, just if you enter a vehicle nothing happends that you can't drive that you can nothing, NOT freeze or something