22.02.2015, 12:20
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.
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; }