engine command not working
#1

Код:
CMD:engineon(playerid, params[])
{
		new objective;
		new boot;
		new bonnet;
		new doors;
		new alarm;
		new lights;
    	        new vehicleid = GetPlayerVehicleID(playerid);
	 if GetPlayerState(playerid) == 2
        GetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective)
        SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective)
        SendClientMessage(playerid, 0x99FF33,"The Engine has been turned on");
        if GetPlayerState(playerid) == !2
        SendClientMessage(playerid, 0x99FF33,"You arent event in a vehicle idiot!");
        return 1;
}
error
Код:
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(27) : warning 217: loose indentation
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(540) : error 001: expected token: "*then", but found "-identifier-"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(540) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(542) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(544) : warning 213: tag mismatch
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(544) : error 001: expected token: "*then", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Can somebody help me?
Reply
#2

At the top of the script:

pawn Код:
new vehicleenginestatus[MAX_VEHICLES];
Under OnVehicleSpawn(vehicleid)

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
SetVehicleParamsEx(vehicleid, 0, 0, 0, doors, 0, 0, objective);
vehicleenginestatus[vehicleid] = 0;
return 1;
Change "engineon" to just "engine" and delete "engineoff" if you have one because this will do both in one command. Under the engine command:

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle.");
if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Yoi are not the driver.");
if(vehicleenginestatus(vehid) == 0) { vehicleenginestatus[vehid] = 1; GetVehicleParamsEx(vehid,  engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehid, 1, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid 0xFFFFFFFF, "Engine has been switched on."); return 1; }
else { vehicleenginestatus[vehid] = 0; GetVehicleParamsEx(vehid,  engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehid, 0, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid 0xFFFFFFFF, "Engine has been switched off."); return 1; }
PS: Scripted from my iPhone so there might be that slight spelling error .
Reply
#3

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
At the top of the script:

pawn Код:
new vehicleenginestatus[MAX_VEHICLES];
Under OnVehicleSpawn(vehicleid)

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
SetVehicleParamsEx(vehicleid, 0, 0, 0, doors, 0, 0, objective);
vehicleenginestatus[vehicleid] = 0;
return 1;
Change "engineon" to just "engine" and delete "engineoff" if you have one because this will do both in one command. Under the engine command:

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle.");
if(GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Yoi are not the driver.");
if(vehicleenginestatus(vehid) == 0) { vehicleenginestatus[vehid] = 1; GetVehicleParamsEx(vehid,  engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehid, 1, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid 0xFFFFFFFF, "Engine has been switched on."); return 1; }
else { vehicleenginestatus[vehid] = 0; GetVehicleParamsEx(vehid,  engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehid, 0, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid 0xFFFFFFFF, "Engine has been switched off."); return 1; }
PS: Scripted from my iPhone so there might be that slight spelling error .
Im getting some errors and I dont know how to fix it because im not figuring out wich ones are they.


Код:
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(4) : error 017: undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(4) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(29) : warning 217: loose indentation
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(477) : warning 203: symbol is never used: "boot"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(477) : warning 203: symbol is never used: "bonnet"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(477) : warning 203: symbol is never used: "alarm"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(477) : warning 203: symbol is never used: "lights"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(477) : warning 203: symbol is never used: "engine"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(541) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(541) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(541) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(541) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(541) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#4

Show me line 4 and 29. Remove line 477. And show me line 541.
Reply
#5

https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights
Reply
#6

Yea.. Could use that too, not necessary but helpful if you want to use manual lights. Add it under OnGameModeInit, Strapz.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)