A szín váltás igen picsán van megírva, azt a 2 színoszlopot törölni is lehet, és ez mendjárt egyszerubb:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(newkeys & ColorChangeKey)
{
ChangeVehicleColor(vehicleid, random(126), random(126));
}
if(newkeys & JumpKey) // Jump
{
new Float:vehx; new Float:vehy; new Float:vehz;
GetVehicleVelocity(vehicleid, vehx, vehy, vehz);
SetVehicleVelocity(vehicleid, vehx, vehy, vehz + Jump);
}
if(newkeys & NosKey) // Nos
{
AddVehicleComponent(vehicleid,1010);
GameTextForPlayer(playerid,\"Nitro hozzaadva\",1000,3);
}
if(newkeys & FlipKey) // Flip
{
new Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(playerid, X, Y, Z);
GetVehicleZAngle(vehicleid, Angle); SetVehiclePos(vehicleid, X, Y, Z); SetVehicleZAngle(vehicleid, Angle);
}
if(newkeys & SBKey) // SpeedBoost
{
new Float:vehx; new Float:vehy; new Float:vehz;
GetVehicleVelocity(vehicleid,vehx,vehy,vehz);
SetVehicleVelocity(vehicleid,vehx*SpeedBoost,vehy*SpeedBoost,vehz*SpeedBoost);
}
if(newkeys & FixKey) // Fix
{
RepairVehicle(GetPlayerVehicleID(playerid));
GameTextForPlayer(playerid,\"Javitva\",1000,3);
}
return 1;
}