Jump to content
  • 0

pomoc [Help]Checkpoint Se Nenastaví


W1nCZ

Dotaz

Dělám si funkci že když nastoupí hráč do auta... jménem grovecar

tak pokud je z teamu A tak mu to napíše že tam nemůže a vyhodi ho to zas ven z auta

pokud je tam z teamu B tak to zruší předchozí checkpoint a nastaví to novej... bohužel jediný co to udělá je že to napíše tu zprávu že tam nemůže nastoupit ... nic jinýho se nestane :(

 

 

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
 if(GetVehicleModel(vehicleid) == grovecar)
{
 if(GetPlayerTeam(playerid) == 2)
 {
  RemovePlayerFromVehicle(playerid);
  GameTextForPlayer(playerid, "Jsi policajt!", 3000, 4);
 }
 else if(GetPlayerTeam(playerid) == 1)
 {
  DisablePlayerRaceCheckpoint(playerid);
  SetPlayerRaceCheckpoint(playerid, 0, 2505.3010,-1694.6429,13.5585, 0, 0, 0, 2);
 }
}
   return 1;
}

toto je to auto

grovecar = CreateVehicle(440,1529.09997559,-1684.30004883,6.19999981,268.00000000,-1,-1,15);

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0

v OnPlayerEnterVehicle nemá byť if(GetVehicleModel(vehicleid)==grovecar) ale if(vehicleid==grovecar)

pretože OnPlayerEnterVehicle neodosiela model ale id auta a grovecar je ID nie model

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

  • 0

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == grovecar)
{
if(GetPlayerTeam(playerid) == 2)
{
RemovePlayerFromVehicle(playerid);
GameTextForPlayer(playerid, "Jsi policajt!", 3000, 4);
}
else if(GetPlayerTeam(playerid) == 1)
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, 2505.3010,-1694.6429,13.5585, 0, 0, 0, 2);
}
}
return 1;
}

 

Takhle to mam a nejde to ... možná bude nějak problém s timhle

 

public navigace(playerid)
{
for(new i=0;i < MAX_PLAYERS_EX;i++)
{
if(GetPlayerVehicleID(i) != grovecar)
{
new Float:x, Float:y, Float:z;
GetVehiclePos(grovecar,x,y,z);
DisablePlayerRaceCheckpoint(i);
SetPlayerRaceCheckpoint (i, 0,x, y, z,0,0,0, 2);
}
}
return 1;
}

 

To je navigace (ten checkpoint kterej to ukazuje k tomu autu)

 

je to na timer kterej to spousti každou 1sec...

a když se spusti timer... tak to spusti cyklus .... a když neni v aute grovecar

tak mu to nastavi checkpoint tam kde je auto...jakože k nemu ma jit...

Link to comment
Share on other sites

  • 0

udelej to v publicu OnPlayerStateChange, ten kontroluje kdyz uz hrac sedi v aute (OnPlayerEnterVehicle kdyz zmackne F u auta)

if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)

Link to comment
Share on other sites

  • 0

udelej to v publicu OnPlayerStateChange, ten kontroluje kdyz uz hrac sedi v aute (OnPlayerEnterVehicle kdyz zmackne F u auta)

if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)

 

děkuju zkusím to ;)

Link to comment
Share on other sites

  • 0
Téma bylo uzavřeno, problém byl vyřešen.

Toto téma bylo uzavřeno, jelikož zakladatel tématu již problém vyřešil.

Pokud máte další dotazy ohledně tohoto tématu, založte si téma nové.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...