Quote:
Originally Posted by psoftware
L-Shift Key doesn't work in vehicles. Try with another key.....
|
Ofcourse it does. I got it working in my server.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new newcar = GetPlayerVehicleID(playerid);
if(newkeys == KEY_JUMP)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(newcar))
{
if(PlayerInfo[playerid][pPcarkey] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == newcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(newcar == 59 || newcar == 60)
{
return 1;
}
if(newcar >= 135 && newcar <= 154)
{
if(HireCar[playerid] != newcar)
{
return 1;
}
}
if(IsAHarvest(newcar))
{
return 1;
}
if(IsADrugHarvest(newcar))
{
return 1;
}
if(IsAPlane(newcar))
{
return 1;
}
if(IsASweeper(newcar))
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }
new playerveh = GetPlayerVehicleID(playerid);
if(playerveh != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(playerveh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(playerveh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
PutPlayerInVehicle(playerid, newcar, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s starts the vehicle engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//SetTimerEx("StartingTheVehicle",3500,0,"i",playerid);
//GameTextForPlayer(playerid, "~w~Starting vehicle engine...",3500,3);
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You started the vehicle's engine. ");
engineOn[GetPlayerVehicleID(playerid)] = true; // remove if wanna use the timer
TogglePlayerControllable(playerid, true); // remove if wanna use the timer
gEngine[playerid] = 1;
return 1;
}
}
}
}