Jump to content
  • 0

pomoc Warp


Kill22

Dotaz

Popis problému:

Jak mám v sampu uložit pozici na místě kde chci mít warp

Jak mám uložit pozici, aby ji pak mohl napsat do pawna

Když sem dal /save tak mě to pak ukázalo: AddPlayerClass(0,1718.3700,1532.7534,10.7846,86.2391,0,0,0,0,0,0);

Ale když to pak dám toto do pawna: 0,1718.3700,1532.7534,10.7846,86.2391,0,0,0,0,0,0 tak mě to wapne na jiné místo

Pls poradte icon_e_confused.gif

 

Chyby/varování kompilátoru a při běhu:

--

 

Kód:

 

--

 

 

 

Dodatečné poznámky:

--

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0

Z toho AddPlayerClass si vyber tyto 3 souřadnice. (barevné)

 

AddPlayerClass(0,1718.3700,1532.7534,10.7846,86.2391,0,0,0,0,0,0);

 

Pozice X = 1718.3700

Pozice Y = 1532.7534

Pozice Z = 10.7846
 

A použij to takto v kódu:

SetPlayerPos(playerid,1718.3700,1532.7534,10.7846);

Edited by OceT
Link to comment
Share on other sites

  • 0

Pomocou ZCMD

CMD:warp(playerid, params[])
{
        #pragma unused params
	SetPlayerPos(playerid,1718.3700,1532.7534,10.7846);
	new veh = GetPlayerVehicleID(playerid);
	if(IsPlayerInVehicle(playerid, veh))
	{
	SetVehiclePos(veh,1718.3700,1532.7534,10.7846);
	new sedacka = GetPlayerVehicleSeat(playerid);
	PutPlayerInVehicle(playerid, veh, sedacka);
	}
	return 1;
}

Normlane

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/warp", cmdtext, true, 10) == 0)
    {
    SetPlayerPos(playerid,1718.3700,1532.7534,10.7846);
    new veh = GetPlayerVehicleID(playerid);
    if(IsPlayerInVehicle(playerid, veh))
    {
    SetVehiclePos(veh,1718.3700,1532.7534,10.7846);
    new sedacka = GetPlayerVehicleSeat(playerid);
    PutPlayerInVehicle(playerid, veh, sedacka);
    }
        return 1;
    }
    return 0;
}

Ak si chcel aby ťa to warplo pri letisko LV vedľa autobusovej zastávky, tak to funguje icon_e_wink.gif

Dal som ti sem príkaz z kt. by si si mohol niečo zobrať + si pozri radu od octa, možno sa v tom lepšie vyznáš.

 

Ak by si sa chcel viac naučiť ohladne tohoto, tak ti doporučujem -> http://wiki.sa-mp.com/wiki/SetPlayerPos | http://wiki.sa-mp.com/wiki/Floats atd.

Edited by Twixo
Link to comment
Share on other sites

  • 0

 

	new veh = GetPlayerVehicleID(playerid);
	if(IsPlayerInVehicle(playerid, veh))

 

Proč deklaruješ proměnnou s hodnotou id vozidla, a až pak teprve kontroluješ, zda vůbec v daném vozidle je?

 

Stačí zjistit zda v nějakém vozidle je všeobecně...

Edited by Ernst Remer
Link to comment
Share on other sites

  • 0

Proč deklaruješ proměnnou s hodnotou id vozidla, a až pak teprve kontroluješ, zda vůbec v daném vozidle je?

 

Stačí zjistit zda v nějakém vozidle je všeobecně...

Ten príkaz som robil tak odfláknuto... jemu stačí aby to fungovalo čo i robí.

 

//edit: Radšej používam IsPlayerInVehicle, lebo si rovno zistím ID auta, ak by  som použil IsPlayerInAnyVehicle, tak by si to i tak zistoval u toho prikazu.

Edited by Twixo
Link to comment
Share on other sites

  • 0
if(IsPlayerInAnyVehicle(playerid) && !GetPlayerVehicleSeat(playerid))
    SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
else
    SetPlayerPos(playerid, x, y, z);

případně můžeš úplně vynechat IsPlayerInAnyVehicle

Edited by Lukasz
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...