change /engine to "ctrl" to start the engine
#6

this time i read the whole page :P


Quote:
Originally Posted by Matnix
Посмотреть сообщение
As I see you don't read what I said check this page for more informations about keys. >https://sampwiki.blast.hk/wiki/Keys<
- You should also post the lines where you got these errors.
i change it when i press number 2 the engine should start:


Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_SUBMISSION)
	    {
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle !");
                return 1;
            }
            if (IsNotAEngineCar(idcar))
            {
                SendClientMessage(playerid,COLOR_GREY," This vehicle dosent even have a Engine !");
				return 1;
            }
            if (IsAHotwireCar(idcar))
            {
                SendClientMessage(playerid,COLOR_GREY," You can't turn the engine 'on' on this vehicle, it's only for learning!");
				return 1;
            }
            if(idcar >= 135 && idcar <= 154)
	        {
                if(HireCar[playerid] != idcar)
				{
				    return 1;
				}
			}
			if(idcar >= 1 && idcar <= 9)
	        {
                if(HireCar[playerid] != idcar)
				{
				    return 1;
				}
			}
			if(IsAnOwnableCar(idcar))
			{
				if(PlayerInfo[playerid][pCarkey] == VehicleOwned[idcar]) { }
		    	else if(PlayerInfo[playerid][pCarkey2] == VehicleOwned[idcar]) { }
		    	else if(PlayerInfo[playerid][pCarkey3] == VehicleOwned[idcar]) { }
		    	else { return 1; }
			}
			if(ReduceTime[playerid] > 0)
            {
                format(string, sizeof(string), " You need to wait %d seconds to type this command.", ReduceTime[playerid]);
				SendClientMessage(playerid, COLOR_GREY, string);
                return 1;
            }
            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GiveNameSpace(sendername);
            if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", RandMask[playerid]); }
			if (VehicleEngine[idcar] == 0)
			{
			    format(string, sizeof(string), "* %s spins the %s's key into the ignition and attempts to turn on the engine.", sendername, VehicleName[GetVehicleModel(idcar)-400]);
			    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			    new RandomStart;
			    RandomStart = random(4);
                switch(RandomStart)
                {
                    case 0,1,2:
                    {
                        if(VehAsk[playerid] == 1)
				        {
				            VehAsk[playerid] = 0;
	            			SetVehicleParamsEx(idcar,1,lights,alarm,doors,bonnet,boot,objective);
			            }
			            VehicleEngine[idcar] = 1;
			            format(string, sizeof(string), "* %s engine starts (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
			            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                    case 3:
                    {
						format(string, sizeof(string), "* %s engine does not start (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
			            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			            ReduceTime[playerid] = 3;
                    }
                }
			}
			else if (VehicleEngine[idcar] == 1)
			{
			    VehicleEngine[idcar] = 0;
			    format(string, sizeof(string), "* %s spins the %s's key into the ignition and turns the engine off.", sendername, VehicleName[GetVehicleModel(idcar)-400]);
			    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			    SetVehicleParamsEx(idcar,false,lights,alarm,doors,bonnet,boot,objective);
		        VehAsk[playerid] = 1;
			}
		}
		return 1;
	}

    if(strcmp(cmd, "/windows", true) == 0 || strcmp(cmdtext, "/wi", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if (!IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle !");
                return 1;
            }
            if (!IsAWindowCar(playerid))
            {
                SendClientMessage(playerid,COLOR_GREY," This vehicle dosent even have windows !");
				return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", RandMask[playerid]); }
			if (VehicleWindows[idcar] == 0)
			{
                VehicleWindows[idcar] = 1;
			    format(string, sizeof(string), "* %s rolls down the window.", sendername);
			}
			else if (VehicleWindows[idcar] == 1)
			{
			    VehicleWindows[idcar] = 0;
			    format(string, sizeof(string), "* %s rolls up the window.", sendername);
			}
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		return 1;
	}
i still get this error


Код:
C:\Users\FLOX122\Desktop\New folder (3)\gamemodes\LSL-RP.pwn(46179) : error 029: invalid expression, assumed zero
C:\Users\FLOX122\Desktop\New folder (3)\gamemodes\LSL-RP.pwn(46179) : error 017: undefined symbol "newkeys"
C:\Users\FLOX122\Desktop\New folder (3)\gamemodes\LSL-RP.pwn(46181) : error 017: undefined symbol "newkeys"
thanks again for ur fast replay
Reply


Messages In This Thread
change /engine to "ctrl" to start the engine - by flox12 - 13.08.2013, 01:20
Re: change /engine to "ctrl" to start the engine - by Isolated - 13.08.2013, 01:28
Re : change /engine to "ctrl" to start the engine - by Matnix - 13.08.2013, 01:32
Re: Re : change /engine to "ctrl" to start the engine - by flox12 - 13.08.2013, 01:41
Re : change /engine to "ctrl" to start the engine - by Matnix - 13.08.2013, 01:45
Re: Re : change /engine to "ctrl" to start the engine - by flox12 - 13.08.2013, 02:16
Re: change /engine to "ctrl" to start the engine - by Onfroi - 13.08.2013, 02:53
Re: change /engine to "ctrl" to start the engine - by flox12 - 13.08.2013, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)