Help [+Rep] - OnPlayerKeyStateChange related
#1

Hey, i need some help.. Here it is
Код:
   	if (PRESSED(KEY_JUMP)) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
		vehicleid = GetPlayerVehicleID(playerid);
		if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_ON)
		{
			SetVehicleEngine(vehicleid, playerid);
		}
		else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
			SetTimerEx("SetVehicleEngine", 1500, 0, "dd",  vehicleid, playerid);
		}
	}
Errors =/
Код:
C:\Users\School\Desktop\samp03dsvr_win32 (1)\gamemodes\3pkrp1.1.pwn(12615) : error 029: invalid expression, assumed zero
C:\Users\School\Desktop\samp03dsvr_win32 (1)\gamemodes\3pkrp1.1.pwn(12615) : warning 215: expression has no effect
C:\Users\School\Desktop\samp03dsvr_win32 (1)\gamemodes\3pkrp1.1.pwn(12615) : error 001: expected token: ";", but found ")"
C:\Users\School\Desktop\samp03dsvr_win32 (1)\gamemodes\3pkrp1.1.pwn(12615) : error 029: invalid expression, assumed zero
C:\Users\School\Desktop\samp03dsvr_win32 (1)\gamemodes\3pkrp1.1.pwn(12615) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

What line is 12615 ?
Reply
#3

Are you sure you have defined: SendClientMessageEx somewhere? because isn't not a standart function of sa-mp.
So might you have to change it to SendClientMessage(

And indeed show us the line that has a error.
Reply
#4

This is the Line you want (error)
if (PRESSED(KEY_JUMP)) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
Reply
#5

pawn Код:
if (PRESSED(KEY_JUMP) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
try this, you added an extra ")" bracket after the KEY_JUMP
Reply
#6

Worked! Thanks mate! +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)