Jump to content
  • 0

pomoc Rovno do auta


AdoUMfsamp

Dotaz

cautem,potrebejem radu ako mam urobit ze ked si auto vitvorim tak nech ho rovno hodi do auta 

cod ako to mam ale porebujem to tak ked ma to tam teleportne tam vitvori auto rovno ma don ho getne 

 

*sry za gramatiku som uz stoho na nervy :d

 

if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))

 {

  GameTextForPlayer(playerid,"Vybral si si blistu.Prijemnu hru.", 5000, 3);

  CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista

  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);

 }

:help:  :help:  ;)

Link to comment
Share on other sites

14 odpovědí na tuto otázku

Recommended Posts

  • 0

skusim :)


public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))
 {
  GameTextForPlayer(playerid,"Vybral si si blistu.Prijemnu hru.", 5000, 3);
  CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista
  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);
  PutPlayerInVehicle(playerid,496,0);
 }
 if(IsPlayerInRangeOfPoint(playerid, 1, 2524.7017,-1678.5266,3683.3388))
 {
  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);
  GameTextForPlayer(playerid,"Vybral si si feltzer.Prijemnu hru.", 5000, 3);
  PutPlayerInVehicle(playerid,533,0);
 }
 if(IsPlayerInRangeOfPoint(playerid, 1, 2522.0200,-1678.5378,3683.3388))
 {
  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);
  GameTextForPlayer(playerid,"Vybral si si club.prijemnu hru.", 5000, 3);
   PutPlayerInVehicle(playerid,589,0);
 }
return 1;
} skusal som
asi to mam zle alebo nwm nejdeto 
Link to comment
Share on other sites

  • 0

 

 

skusim :)

public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))
 {
  GameTextForPlayer(playerid,"Vybral si si blistu.Prijemnu hru.", 5000, 3);
  CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista
  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);
  PutPlayerInVehicle(playerid,496,0);
 }
 if(IsPlayerInRangeOfPoint(playerid, 1, 2524.7017,-1678.5266,3683.3388))
 {
  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);
  GameTextForPlayer(playerid,"Vybral si si feltzer.Prijemnu hru.", 5000, 3);
  PutPlayerInVehicle(playerid,533,0);
 }
 if(IsPlayerInRangeOfPoint(playerid, 1, 2522.0200,-1678.5378,3683.3388))
 {
  SetPlayerPos(playerid,1965.1685,1764.1351,18.9339);
  GameTextForPlayer(playerid,"Vybral si si club.prijemnu hru.", 5000, 3);
   PutPlayerInVehicle(playerid,589,0);
 }
return 1;
} skusal som
asi to mam zle alebo nwm nejdeto 

 

udělej to takto 

 

 PutPlayerInVehicle(playerid, CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60), 0);

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

  • 0
if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))
{
    GameTextForPlayer(playerid,"Vybral si si blistu.Prijemnu hru.", 5000, 3);
    new auto;
    auto = CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista
//portovať ho nemusíš
    PutPlayerInVehicle(playerid,auto,0);
}

alebo takto :d

Link to comment
Share on other sites

  • 0
if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))
{
    GameTextForPlayer(playerid,"Vybral si si blistu.Prijemnu hru.", 5000, 3);
    new auto;
    auto = CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista
//portovať ho nemusíš
    PutPlayerInVehicle(playerid,auto,0);
}

alebo takto :d

 

jasný budem dělat zbytečné proměné... :) proč ne

 

když už zbytečně natahuješ kod.. tak alespon takto

new auto = CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista

Edited by Steam Wallet
Link to comment
Share on other sites

  • 0

udělej to takto 

 

 PutPlayerInVehicle(playerid, CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60), 0);

Diki bro ale mesto to ho aby mi 1 auto vitvorilo tak ich vitvori asi 5

:d

Link to comment
Share on other sites

  • 0

pošli foto + code. kde přesně to dělá.

public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))
 {
  PutPlayerInVehicle(playerid, CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60), 0);
  GameTextForPlayer(playerid,"Vybral si si blistu.Prijemnu hru.", 5000, 3);
 }
 if(IsPlayerInRangeOfPoint(playerid, 1, 2524.7017,-1678.5266,3683.3388))
 {
  PutPlayerInVehicle(playerid, CreateVehicle(533, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60), 0);
  GameTextForPlayer(playerid,"Vybral si si feltzer.Prijemnu hru.", 5000, 3);
 }
 if(IsPlayerInRangeOfPoint(playerid, 1, 2522.0200,-1678.5378,3683.3388))
 {
  PutPlayerInVehicle(playerid, CreateVehicle(589, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60), 0);
  GameTextForPlayer(playerid,"Vybral si si club.prijemnu hru.", 5000, 3);
 }
return 1;
}
Link to comment
Share on other sites

  • 0

jasný... proč to sakra daváš do onplayerupdate?? se nediv že to tam máš 5x

pokud to chceš mít jako že nastoupí do auta tak si to dej do

 

https://wiki.sa-mp.com/wiki/OnPlayerEnterVehicle

 

nebo si to udělej před dialog.

Edited by Steam Wallet
  • Líbí se mi to! (+1) 2
Link to comment
Share on other sites

  • 0

jasný budem dělat zbytečné proměné... :) proč ne

 

když už zbytečně natahuješ kod.. tak alespon takto

new auto = CreateVehicle(496, 1965.1685,1764.1351,18.9339, 82.2873, -1, -1, 60);//blista

jake zbytecne promene ? vsak jakmile to vyjede z te urvone ({ }) tak to promenou smaze.

Link to comment
Share on other sites

  • 0

jake zbytecne promene ? vsak jakmile to vyjede z te urvone ({ }) tak to promenou smaze.

je to zbytečné to tam dělat pokud to nechce využít na tuning třeba. vím že se smaže ale i tak udělal 2 zbytečné řádky když to šlo na jeden oto mi šlo. 

prostě podle mě je to strašná kravina tam dělat proměnu když to chce využít jenom na posazení hráče do auta. zbytečně si kód natahuje pak a je více nepřehledný. 

Edited by Steam Wallet
Link to comment
Share on other sites

  • 0

je to zbytečné to tam dělat pokud to nechce využít na tuning třeba. vím že se smaže ale i tak udělal 2 zbytečné řádky když to šlo na jeden oto mi šlo. 

prostě podle mě je to strašná kravina tam dělat proměnu když to chce využít jenom na posazení hráče do auta. zbytečně si kód natahuje pak a je více nepřehledný. 

 

To už záleží ale na něm né? Jak se mu to líbí, já tedy preferuji to s tou tvorbou proměnné, a né to co jsi psal, to je pro mě nepřehledné.

Link to comment
Share on other sites

  • 0

je to zbytečné to tam dělat pokud to nechce využít na tuning třeba. vím že se smaže ale i tak udělal 2 zbytečné řádky když to šlo na jeden oto mi šlo. 

prostě podle mě je to strašná kravina tam dělat proměnu když to chce využít jenom na posazení hráče do auta. zbytečně si kód natahuje pak a je více nepřehledný. 

To je stejne uplne bezpredmetne, protoze je vyhrazena pamet pro operace (#pragma dynamic ..) pokud se nepletu, takze uz je uplne jedno jestli ji vyuzijes nebo ne.Tak jako ta musi byt uvolnena pro spravny beh scriptu. Pomoci toho pragmatu si ji muzes zvysit/zmensit podle potreb a moznosti hadrwaru. Tam je dulezity aby sis pamet nevycerpal (rekurze) a nebo sis nastavil dostatecnou velikost, coz kdyz si nastavujes velikost, tak musis vedet ze mas dost velke RAM a ze ti to nebude zrat jina aplikace.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...