Das Problem hatte ich auch. Ich habs dann so gemacht:
Bei OnPlayerCommandText:
if(strcmp("/tune", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10.0,797.6604,-618.7686,16.3359))
{
if(IsPlayerInAnyVehicle(playerid))
{
new zufall2 = random(4);
if(zufall2 == 0)
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1008);
AddVehicleComponent(GetPlayerVehicleID(playerid),1075);
ChangeVehicleColor(GetPlayerVehicleID(playerid),000,000);
GivePlayerMoney(playerid,-750);
GameTextForPlayer(playerid,"Vehicle getuned!",3000,1);
return 1;
}
else if(zufall2 == 1)
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1008);
AddVehicleComponent(GetPlayerVehicleID(playerid),1078);
ChangeVehicleColor(GetPlayerVehicleID(playerid),001,000);
GivePlayerMoney(playerid,-750);
GameTextForPlayer(playerid,"Vehicle getuned!",3000,1);
return 1;
}
else if(zufall2 == 2)
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1008);
AddVehicleComponent(GetPlayerVehicleID(playerid),1074);
ChangeVehicleColor(GetPlayerVehicleID(playerid),180,003);
GivePlayerMoney(playerid,-750);
GameTextForPlayer(playerid,"Vehicle getuned!",3000,1);
return 1;
}
else if(zufall2 == 3)
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1008);
AddVehicleComponent(GetPlayerVehicleID(playerid),1073);
ChangeVehicleColor(GetPlayerVehicleID(playerid),006,183);
GivePlayerMoney(playerid,-750);
GameTextForPlayer(playerid,"Vehicle getuned!",3000,1);
return 1;
}
}
else
{
SendClientMessage(playerid,ROT,"Du bist nicht im Fahrzeug!");
return 1;
}
else
{
SendClientMessage(playerid,ROT,"Du bist nicht in der TuneGarage!");
SendClientMessage(playerid,LILA,"~(/tunegarage um dich hinzuteleportieren.)~");
return 1;
}
}
Also wenn der Player in den Koordinaten ist und /tune eingibt, wird das Fahrzeug getuned.