WOW! Engine problem - Engine starts with Forward(W) KEY!
#1

So as you can tell from the name of this thread I'm not even mad, I'm amazed
But for real, Engine should start with KEY_SPRINT and instead it starts with undetectable key W (the one to go forward).

I thought it may be my PC doing some strange binding or something, but my friend also tested with his PC.

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  	if(newkeys & KEY_SPRINT)
    {
    	if(IsPlayerInAnyVehicle(playerid))
    	{
			new vehicleid = GetPlayerVehicleID(playerid);
			new engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
			    if(EngineStarting[playerid] == 0){
				if(engine == 0)
				{
   					EngineStarting[playerid] = 1;
    				SetTimerEx("StartEngine", 3000, 0, "i", playerid);
    				SendClientMessage(playerid, COLOR_YELLOW, "Uюvedamas variklis...");
				}
				if(engine == 1)
				{
		    		engine = 0;
		    		SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
					SendActionMessage(playerid,"iрjungл variklб.");
				}
				if(engine == -1)
				{
					SetVehicleParamsEx(vehicleid,0,0,alarm,doors,bonnet,boot,objective);
				}
				}
				else return 0;
    		        }
		}
	}
...
return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) {
    switch(GetPlayerState(playerid)) {
        case PLAYER_STATE_DRIVER: {
            new vehicleid = GetPlayerVehicleID(playerid);
            SendClientMessage(playerid,COLOR_YELLOW,"[VARIKLIS]: "COL_WHITE"Norint uюvesti variklб spausk SHIFT");
            if(EngineBroken[vehicleid] != 1){
            	CheckEngine[playerid] = SetTimerEx("EngineValue", 1000, true, "ii", playerid, GetPlayerVehicleID(playerid));
            }
        }
        case PLAYER_STATE_ONFOOT: {
            KillTimer(CheckEngine[playerid]);
            EngineStarting[playerid] = 0;
        }
    }
    return 1;
}
Reply
#2

W is the default sprint key in a car. Here use this as a guide for setting your keys.

https://sampwiki.blast.hk/wiki/Keys

In other words, you want to use KEY_HANDBRAKE to start with the spacebar
Reply
#3

Well what do you know how did I miss that
Reply
#4

Quote:
Originally Posted by SkiT'aZ
Посмотреть сообщение
Well what do you know how did I miss that
It's cool! We all overlook things at times.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)