0.3c Vehicle System Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 0.3c Vehicle System Help (
/showthread.php?tid=252897)
0.3c Vehicle System Help -
Dokins - 03.05.2011
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.
Re: 0.3c Vehicle System Help -
abubaker98 - 03.05.2011
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
Re: 0.3c Vehicle System Help -
Skylar Paul - 03.05.2011
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.
Re: 0.3c Vehicle System Help -
Dokins - 09.05.2011
Thank you.