Üdv!
Kellene egy kis segítség ebben:
#include <a_samp>
forward Update(playerid);
new Timers[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/dsr-tuning\", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, 0xAA3333AA, \"Nem ülsz kocsiban!\");
new vid = GetPlayerVehicleID(playerid);
if(!IsVehicleSkinCompatible_TF(GetVehicleModel(vid)))
return SendClientMessage(playerid, 0xAA3333AA, \"Nem rakhatsz ebbe a jármûbe tuningot!\");
AddVehicleComponent(vid, 1079);
Timers[playerid] = SetTimerEx(\"Update\", 20000, true, \"i\", playerid);
return SendClientMessage(playerid, 0x0FFDD349, \"Sikeresen felraktad a tuningot.\");
}
return 0;
}
public Update(playerid)
{
if(!IsPlayerConnected(playerid) || !IsPlayerInAnyVehicle(playerid))
return KillTimer(Timers[playerid]);
new vid = GetPlayerVehicleID(playerid);
if(!IsVehicleSkinCompatible_TF(GetVehicleModel(vid)))
return KillTimer(Timers[playerid]);
AddVehicleComponent(vid, 1032);
AddVehicleComponent(vid, 1079);
AddVehicleComponent(vid, 1010);
AddVehicleComponent(vid, 1060);
AddVehicleComponent(vid, 1138);
return 1;
}
IsVehicleSkinCompatible_TF(skinid)
{
switch(skinid)
{
case 560: return true;
}
return false;
}
Nah ezt kéne megcsinálni úgy, hogy ne minden sultanra ugorjon fel a tuning hanem csak erre:
AddStaticVehicle(560,306.2663,-237.7956,1.2837,271.2222,0,0);
AddStaticVehicle(560,305.9423,-242.1924,1.2836,269.4264,0,0);
Köszi a segítséget!