Sziasztok.
Van egy ilyenem.:
public Startup(playerid, vehicleid)
{
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new newcar = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
{
//I do nothing!
}
else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !Halaszhajo(newcar) && !IsASweeper(newcar))
{
if(AdminDuty[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHT_BLUE, \"Figyelem! Elõször be kell indítanod a motort a \'SHIFT\' billentyûvel!\");
TogglePlayerControllable(playerid, false);
vehicleEntered[playerid][vehicleid] = true;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2,\"Admin szolgálatban tudod vezetni!\");
}
}
else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 59 && newcar != 60 && !IsAPlane(newcar) && !IsAHarvest(newcar) && !Halaszhajo(newcar) && !IsASweeper(newcar))
{
if(AdminDuty[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHT_BLUE, \"Figyelem! Elõször be kell indítanod a motort a \'SHIFT\' billentyûvel!\");
TogglePlayerControllable(playerid, false);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2,\"Admin szolgálatban tudod vezetni!\");
}
}
}
public engine2(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
{
TogglePlayerControllable(playerid, 1);
}
}
stock strvalEx( const string[] ) // fix for strval-bug with > 50 letters.
{
// written by mabako in less than a minute :X
if( strlen( string ) >= 50 ) return 0; // It will just return 0 if the string is too long
return strval(string);
}
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_SECONDARY_ATTACK && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(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(kerekbilincs[GetPlayerVehicleID(playerid)] != 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, \"Ezen az autón kerékbilincs van! Hívj szerelõt és leszedi!\");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(IsAHarvest(newcar))
{
return 1;
}
if(Halaszhajo(newcar))
{
return 1;
}
if(IsAPlane(newcar))
{
return 1;
}
if(IsASweeper(newcar))
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }
PutPlayerInVehicle(playerid, newcar, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), \"* %s behelyezi és elfordítja a kocsikulcsot.\", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerChatBubble(playerid, \"behelyezi és elfordítja a kocsikulcsot.\", COLOR_PURPLE, 80.0, 10000);
SetTimerEx(\"StartingTheVehicle\",3500,0,\"i\",playerid);
GameTextForPlayer(playerid, \"~w~~n~~n~~n~~n~Beindul a jármû motorja...\",3500,3);
gEngine[playerid] = 1;
return 1;
}
}
}
}
else if(newkeys == KEY_SECONDARY_ATTACK)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(gEngine[playerid] == 0 && engineOn[newcar] == 0)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
else if(NoFuel[playerid] == 1)
{
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicle(playerid);
NoFuel[playerid] = 0;
return 1;
}
}
}
else if ((newkeys & CCKey) && !(oldkeys & CCKey) && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
if (GetVehicleSpeed(vid) == 0) return false;
new Float:x, Float:y, Float:z;
GetVehicleVelocity(vid, x, y, z);
GetVehicleZAngle(vid, PlayerHeadingAngle[playerid]);
DistanceFlat(0, 0, x, y, PlayerCruiseSpeed[playerid]);
SetTimerEx(\"CruiseControl\", 500, false, \"d\", playerid);
}
else if (PlayerCruiseSpeed[playerid] != 0.00 && (newkeys & KEY_HANDBRAKE))
{
PlayerCruiseSpeed[playerid] = 0.00;
}
return 1;
}
És én ezt úgy szeretném beállítani hogy ne a \'SHIFT\' gomb lenyomásával indulljon el az autó hanem parancsra. Például /motorindít Hogy lehessen evvel a kölcsön kulcsot is használni.
Válaszokat elõre is köszönöm !