hallo, kann mir jemand dieses System so umscripten, das man den Motor mit der Linken STRG Tanste einschaltet und mit der ALT Taste wieder abstellt ?
#include <a_samp>
#define COLOR_RED 0xCC0000AA
#define COLOR_GREEN 0x33FF00AA
new vEngine[MAX_VEHICLES];
new BrowsingCar;
forward Main();
public Main()
{
print("<|-----------------------------------------|>");
print(" |.:[ - Engine system v2.0 by James_Alex - ]:.|");
print("<|-----------------------------------------|>");
}
public OnFilterScriptInit()
{
//Anything
return 1;
}
public OnFilterScriptExit()
{
//Anything
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if (vEngine[vehicleid] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "Drücke '0' um den Motor zu starten");
SendClientMessage(playerid, COLOR_RED, "Drücke '2' um den Motor abzustellen");
TogglePlayerControllable(playerid, 0);
BrowsingCar = 1;
}
return 1;
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newkeys == KEY_FIRE)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(vEngine[vehicleid] == 0)
{
vEngine[vehicleid] = 1;
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~g~Motor gestartet", 3000, 5);
BrowsingCar = 0;
return 1;
}
}
}
if(newkeys == KEY_SUBMISSION)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(vEngine[vehicleid] == 1)
{
vEngine[vehicleid] = 0;
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~r~Motor abgestellt", 3000, 5);
BrowsingCar = 1;
return 1;
}
}
}
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(BrowsingCar == 1)
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
BrowsingCar = 0;
return 1;
}
}
}
return 1;
}