SA-MP Forums Archive
Few and easy errors to fix but I don't know how - 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: Few and easy errors to fix but I don't know how (/showthread.php?tid=601024)



Few and easy errors to fix but I don't know how - TheThirdNeo - 15.02.2016

Hello I got some errors can you fix them for me?
Код:
./includes/callbacks.pwn(5067) : warning 215: expression has no effect
./includes/callbacks.pwn(5067) : error 001: expected token: ";", but found ")"
./includes/callbacks.pwn(5067) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(5076) : fatal error 107: too many error messages on one line

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


6 Errors.
Command that has errors:
Код:
Line that has Error:(5076)	if(newkeys & KEY_YES) 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 || DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == 1 && GetVehicleModel(vehicleid) == 592) 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);
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid, 1));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
		{
			if (GetPVarInt(playerid, "Refueling")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while refueling.");
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine starts.", GetPlayerNameEx(playerid, 1));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
			SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
		}
	}



Re: Few and easy errors to fix but I don't know how - Trucido - 16.02.2016

Код:
Line that has Error:(5076)	if(newkeys & KEY_YES) IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
...can you even put in a little effort yourself?

Код:
if( ( newkeys & KEY_YES ) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)



Re: Few and easy errors to fix but I don't know how - YGComeUPs - 16.02.2016

you just got told


Re: Few and easy errors to fix but I don't know how - TheThirdNeo - 16.02.2016

I got a few other errors :
Код:
./includes/callbacks.pwn(5067) : warning 217: loose indentation
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(5076) : fatal error 107: too many error messages on one line

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


4 Errors.
Line:
Код:
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid, 1));



Re: Few and easy errors to fix but I don't know how - -CaRRoT - 16.02.2016

Quote:
Originally Posted by TheThirdNeo
Посмотреть сообщение
I got a few other errors :
Код:
./includes/callbacks.pwn(5067) : warning 217: loose indentation
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(5076) : fatal error 107: too many error messages on one line

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


4 Errors.
Line:
Код:
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid, 1));
Add
Код:
new string[128];
at the top of your command.


Re: Few and easy errors to fix but I don't know how - Amunra - 16.02.2016

Quote:
Originally Posted by TheThirdNeo
Посмотреть сообщение
I got a few other errors :
Код:
./includes/callbacks.pwn(5067) : warning 217: loose indentation
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 017: undefined symbol "string"
./includes/callbacks.pwn(5076) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(5076) : fatal error 107: too many error messages on one line

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


4 Errors.
Line:
Код:
			format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid, 1));
Make

PHP код:
new string[128];
format(stringsizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops."GetPlayerNameEx(playerid1)); 
And Make at Top Gamemode #pragma tabsize 0 << Not is Recommended !
Recommended >> Make your Line parallel