Jump to content
  • 0

pomoc Tak zase já a PickUp :D


mourison

Dotaz

Opět prosím šikovné lidičky o radu :d , Stručně řečeno vjedu do PickUpu a nezobrazí se dialog :((, Prosím o radu, Děkuji :)

#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%4,%1,%2,%3)
CreatePickup(1244 , 1, 2115.4805,921.4605,10.5474,-1); //benzinka
CreatePickup(1244  , 1,2203.0952,2472.4285,10.5474,-1); //benzinka
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(IsPlayerInSphere(playerid, 2115.4805,921.4605,10.5474,4))//benzinka
{
 	if(IsPlayerInAnyVehicle(playerid))
 	{
		ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
	}

}
if(IsPlayerInSphere(playerid,2203.0952,2472.4285,10.5474,4))//benzinka
{
	if(IsPlayerInAnyVehicle(playerid))
 	{
		ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
	}
}
	return 1;
}
Link to comment
Share on other sites

24 odpovědí na tuto otázku

Recommended Posts

  • 0

Hmm.. :d, Pickupy dávaj podla newov,

new benzinka1;
benzinka1 = CreatePickup(..)

Potom do OnPlayerPickupPickUp dávaj

    if(pickupid == benzinka1)
    {
    // Čo sa stane ak vstúpi do Pickupu benzinka1
    }

A ešte.. IsPlayerRangeOfPoint dávaj iba ak má niečo stlačít.. Napr.: L.ALT aby zobrazilo dialog ;) Pickup ti otvorí automaticky ked donho vstúpiš. A nedefinuj si zbytočne funkciu na uplne niečo iné abo s prehodenými paramamy. Nwm či to je kvoli tomu ale ked tak daj si iba

#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%1,%2,%3,%4)
Edited by Carlosoo
Link to comment
Share on other sites

  • 0

Prohozovali ?? Ja mám Pickupy tiež takto a funguje normálne.. Jak ma v tomto vedieť jaký Pickup sa má vyvolať..

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(IsPlayerInSphere(playerid, 2115.4805,921.4605,10.5474,4))//benzinka
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }

}
// Podla mna by to tu malo Crashnúť.. ale ked ide,
// Musíš tu máš if(pickupid == ..) a nie jak to máš ty 
// A ked tak.. Musíš mať new pokial máš viac Pickupov s tým istým ID
if(IsPlayerInSphere(playerid,2203.0952,2472.4285,10.5474,4))//benzinka
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }
}
    return 1;
}

EDITED:

 

 

new benzinka;
new benzinkaa;
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == benzinka) // Ked Pickup na ktorý vstúpil je benzinka
{
if(IsPlayerRangeOfPoint(playerid, 2.0 ,2115.4805,921.4605,10.5474))// Pokial je v blízkosti 2
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }

}}

if(pickupid == benzinkaa) // Ked Pickup na ktorý vstúpil je benzinka1
{
if(IsPlayerRangeOfPoint(playerid, 2.0,2203.0952,2472.4285,10.5474))// Pokial je v blízkosti 2
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }
}}
return 1;
}

 

 

Edited by Carlosoo
Link to comment
Share on other sites

  • 0

 

Hmm.. :d, Pickupy dávaj podla newov,

new benzinka1;
benzinka1 = CreatePickup(..)

Potom do OnPlayerPickupPickUp dávaj

    if(pickupid == benzinka1)
    {
    // Čo sa stane ak vstúpi do Pickupu benzinka1
    }

A ešte.. IsPlayerRangeOfPoint dávaj iba ak má niečo stlačít.. Napr.: L.ALT aby zobrazilo dialog ;) Pickup ti otvorí automaticky ked donho vstúpiš. A nedefinuj si zbytočne funkciu na uplne niečo iné abo s prehodenými paramamy. Nwm či to je kvoli tomu ale ked tak daj si iba

#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%1,%2,%3,%4)

jistě.. funkce 

IsPlayerInRangeOfPoint

je jenom na tlačítka no... 

 

ktomu dialogu.. celkem blbá otázka ale seš v autě ?:d

Link to comment
Share on other sites

  • 0

Mě ale nejde ani to IsPlayerRangeOfPoint :d

Prostě se neotevře dialog :d:((

vtom případě mi řekni kde zde máš X,Y,Z,RANGE

if(IsPlayerInSphere(playerid, 2115.4805,921.4605,10.5474,4))
Link to comment
Share on other sites

  • 0

a teď jen tak ze zajímavosti zkus vložit do kódu takle tu podmínku

 

podle mě máš prostě špatnou definici...

 

#define IsPlayerInSphere(%0, %1, %2, %3, %4) IsPlayerInRangeOfPoint(%0, %4, %1, %2, %3)

if(IsPlayerInSphere(playerid, 2115.4805,4,921.4605,10.5474))
Edited by Steam wallet
Link to comment
Share on other sites

  • 0

S tvojí definicí

C:\Users\Zuzana\Desktop\SAMP_server\gamemodes\mujmod.pwn(1374) : warning 236: unknown parameter in substitution (incorrect #define pattern)
error 029: invalid expression, assumed zero
řádek .. if(IsPlayerInSphere(playerid, 2115.4805,4921.4605,10.5474))
Link to comment
Share on other sites

  • 0

 

S tvojí definicí

C:\Users\Zuzana\Desktop\SAMP_server\gamemodes\mujmod.pwn(1374) : warning 236: unknown parameter in substitution (incorrect #define pattern)
error 029: invalid expression, assumed zero
řádek .. if(IsPlayerInSphere(playerid, 2115.4805,4921.4605,10.5474))

prostě tam napiš

if(IsPlayerInRangeOfPoint(playerid,10 ,2115.4805,4921.4605,10.5474))
Link to comment
Share on other sites

  • 0

Pokud odstraním podmínku pro auto a vejdu pěšky, dialog se zobrazí

if(IsPlayerInRangeOfPoint(playerid,10, 2115.4805,4921.4605,10.5474))
{

        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");

}
Link to comment
Share on other sites

  • 0

Pokud se pickupy "prohazuji" muze za to pouze autor kodu (idiot) :), takze IsPlayerInRangeOfPoint nepouzivej. Pouzivej klasicky porovnani promenne.

 

Jako typ pickupu pouzij 14 a ne 1

Link to comment
Share on other sites

  • 0

Ale pickup 14 zmizne po sebrání :(

tak ho znovu vytvor (a nezapomen smazat ten stary, i kdyz ho nevidis tak existuje)

Edited by ATomas
Link to comment
Share on other sites

  • 0

Teď jsem úplně nepochopil, jak by to mělo vypadat :)

if(IsPlayerInRangeOfPoint(playerid,10, 2115.4805,4921.4605,10.5474))
{
    
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");

}

Mám to takhle, pokud dám IsPlayerInvehicle nezobrazí se dialog :) ,

Edited by mourison
Link to comment
Share on other sites

  • 0


new b1 = CreatePickup(1244,14 2115.4805,921.4605,10.5474,-1); //benzinka
new b2 = CreatePickup(1244,14,2203.0952,2472.4285,10.5474,-1); //benzinka

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(IsPlayerInSphere(playerid,2115.4805,921.4605,10.5474,4))//benzinka
    {
        DestroyPickup(b1);
        b1 = CreatePickup(1244,14 2115.4805,921.4605,10.5474,-1);
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }
    if(IsPlayerInSphere(playerid,2203.0952,2472.4285,10.5474,4))//benzinka
    {
        DestroyPickup(b2);
        b2 = CreatePickup(1244,14,2203.0952,2472.4285,10.5474,-1);
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }
    return 1;
}

 

Edited by ATomas
Link to comment
Share on other sites

  • 0

Pickup zmizí ale nevytvoří se znova a dialog se neozbrazí :(( už nevím co s tím :((

new b1;
new b2;
new b3;
 if(IsPlayerInSphere(playerid,2115.4805,921.4605,10.5474,4))//benzinka
    {
        DestroyPickup(b1);
        b1 = CreatePickup(1244,14, 2115.4805,921.4605,10.5474,-1);
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }
    if(IsPlayerInSphere(playerid,2203.0952,2472.4285,10.5474,4))//benzinka
    {
        DestroyPickup(b2);
        b2 = CreatePickup(1244,14,2203.0952,2472.4285,10.5474,-1);
        ShowPlayerDialog(playerid,DIALOG_BENZINKA, DIALOG_STYLE_INPUT, "Stanice", "Cena za litr: 31$\nKolik litrů ?:", "Tankuj", "Konec");
    }
Edited by mourison
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...