-
Ü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!
-
new kocsi1, kocsi2;
kocsi1 = AddStaticVehicle(560,306.2663,-237.7956,1.2837,271.2222,0,0);
kocsi2 = AddStaticVehicle(560,305.9423,-242.1924,1.2836,269.4264,0,0);
Lekérdezés:
if(IsPlayerInVehicle(playerid, kocsi1) || IsPlayerInVehicle(playerid, kocsi2))
-
Beleírnád légyszives?
-
#include <a_samp>
forward Update(playerid);
new Timers[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/dsr-tuning\", cmdtext, true, 10) == 0)
{
if(!IsPlayerInVehicle(playerid, kocsi1) || !IsPlayerInVehicle(playerid, kocsi2))
return SendClientMessage(playerid, 0xAA3333AA, \"Nem ülsz a megfelelõ 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) || if(!IsPlayerInVehicle(playerid, kocsi1) || !IsPlayerInVehicle(playerid, kocsi2))
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;
}
-
Nem jó...
És ezt hova kell írni?
kocsi1 = AddStaticVehicle(560,306.2663,-237.7956,1.2837,271.2222,0,0);
kocsi2 = AddStaticVehicle(560,305.9423,-242.1924,1.2836,269.4264,0,0);
-
OnGameModeInit
-
FS ben nincs ilyen csak gm ben...
És nem is sikerül... Valaki legyen szives megírni nekem légyszives.. és feltölteni.