Jump to content
  • 0

pomoc Pickup a Dialog


Volfik

Dotaz

Čau lidi jak mám udělat pickup a když dotoho pickup vlezete tak se vám ukáže dialog a vtom dialogu bude npř.:zbraně skin atd.. a když těch dialogu chci více tak to mam udělat jak prosím poradíte ?

Link to comment
Share on other sites

10 odpovědí na tuto otázku

Recommended Posts

  • 0

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

 

Do OnGameModeInit alebo script...

 

CreatePickup(1239,1,x,y,z); // x,y,z i ostatné veci si môžeš zmeniť

 

Do OnPlayerPickUpPickup

 

 

if(IsPlayerInSphere(playerid,x,y,z,3)) // x, y ,z tie čo si použil vyššie a 3 je rádius, môžeš si zvoliť aký chceš..

{

ShowPlayerDialog(playerid,20,DIALOG_STYLE_LIST,"PickUp menu","Vybrať skin\nNastaviť si 100 HP","Potvrdiť","Zrušiť");// nezabudni na ID dialogu 20, môžeš si dať aj svoje vlastné..

}

 

do OnDialogResponse

 

 

if(dialogid == 20)// tu ID dialogu

{

if(response == 1) // ľavé tlačítko, pre pravé daj 0

{

if(listitem == 0)

{

SetPlayerSkin(playerid, 164);

}

else if(listitem == 1)

{

SetPlayerHealth(playerid, 100.0);

}

}

}

return 1;

}

 

 

Snáď ti to pomôže... ak je tam chyba tak povedz a opravíme ;-)

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

  • 0

Šak som ti to tu presne rozpísal ako to je...

a keď chceš viac, tak zrobíš toto viackrát samozrejme, ale dávaj iné ID dialogov, aby sa ti to potom neprekrývalo a nerobilo neplechu ;-)

Link to comment
Share on other sites

  • 0

a můžeto být takhle ? :-)

#include <a_samp>
#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%4,%1,%2,%3)

public OnGameModeInit()
CreatePickup(1239,-1590.7410,715.0181,-5);


public OnPlayerPickUpPickup(playerid, pickupid)
if(IsPlayerInSphere(playerid, -1590.7410,715.0181,3)) //
{
 ShowPlayerDialog(playerid,111,DIALOG_STYLE_LIST,"PickUp menu","Hasič z Dejachakem\nHasiš z BezDejchaku\nZbran1\nZbran2","Potvrdiť","Zrušiť");//
}
public OnDialogResponse

if(dialogid == 111)// tu ID dialogu
{
if(response == 1) // ľavé tlačítko, pre pravé daj 0
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 164);//z dejchakem
}
else if(listitem == 1)
{
SetPlayerSkin(playerid, 168);//bez dejchaku
}
else if(listitem == 2)
}
GivePlayerWeapon(playerid, 43,500); //Fotak
}
else if(listitem == 3)
}
GivePlayerWeapon(playerid, 23,100); // zbran 1
}
else if(listitem == 4)
}
GivePlayerWeapon(playerid, 34,100); //zbran 2
}
return 1;
}



Link to comment
Share on other sites

  • 0

chýbajú ti { a } .. neovládaš základy pawna... počkaj opravím ti to

 

Nech sa ti páči

 

 

#include <a_samp>

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

#pragma tabsize 0

 

public OnGameModeInit()

{

CreatePickup(1239,1,5,5,5); // 5,5,5 si prepíš na svoje X Y Z, aj ostatné funkcie pickupu si možeš zmeniť

return 1;

}

 

public OnPlayerPickUpPickup(playerid, pickupid)

{

if(IsPlayerInSphere(playerid, 5,5,5,3))// 5,5,5 si prepíš na svoje X Y Z

{

ShowPlayerDialog(playerid,111,DIALOG_STYLE_LIST,"PickUp menu","Hasič z Dejachakem\nHasiš z BezDejchaku\nZbran1\nZbran2","Potvrdiť","Zrušiť");

}

return 1;

}

public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])

{

if(dialogid == 111)// tu ID dialogu

{

if(response == 1) // ľavé tlačítko, pre pravé daj 0

{

if(listitem == 0)

{

SetPlayerSkin(playerid, 164);//z dejchakem

}

else if(listitem == 1)

{

SetPlayerSkin(playerid, 168);//bez dejchaku

}

else if(listitem == 2)

{

GivePlayerWeapon(playerid, 43,500); //Fotak

}

else if(listitem == 3)

{

GivePlayerWeapon(playerid, 23,100); // zbran 1

}

else if(listitem == 4)

{

GivePlayerWeapon(playerid, 34,100); //zbran 2

}

}

}

return 1;

}

Link to comment
Share on other sites

  • 0

Díky Hover :-) a poradil by jsi my ještě jak jich mam udělat více těch dialogu ? a pickapu vím že do OnGameModeInit dám zase CreatePickup(x,y,i) ale dál už nevím ale jinak díky za radu..

Link to comment
Share on other sites

  • 0
new mujpickup;

public OnGameModeInit()
{
mujpickup = CreatePickup(ID,1,X,Y,Z);
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == mujpickup){
ShowPlayerDialog(playerid,32,DIALOG_STYLE_LIST,......);
}
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

if(dialogid == 32)
{
if(response == 1)
{
if(listitem == 0)
{
................
}
if(listitem == 1)
{
..........................
}
}
}

}

Link to comment
Share on other sites

  • 0

#include <a_samp>
#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%4,%1,%2,%3)
#pragma tabsize 0
public OnGameModeInit()
{
CreatePickup(1239,1,5,5,5); // 5,5,5   si prepíš na svoje X Y Z, aj ostatné funkcie pickupu si možeš zmeniť
CreatePickup(1239,1,2,2,2);// 2,2,2 si zmeň na svoje X Y Z
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(IsPlayerInSphere(playerid, 5,5,5,3))// 5,5,5   si prepíš na svoje X Y Z
{
	 ShowPlayerDialog(playerid,111,DIALOG_STYLE_LIST,"PickUp menu","Hasič z Dejachakem\nHasiš z BezDejchaku\nZbran1\nZbran2","Potvrdiť","Zrušiť");
}
if(IsPlayerInSphere(playerid, 2,2,2,3))// 2,2,2   si prepíš na svoje X Y Z
{
	 ShowPlayerDialog(playerid,429,DIALOG_STYLE_LIST,"PickUp menu","Hasič z Dejachakem\nHasiš z BezDejchaku\nZbran1\nZbran2","Potvrdiť","Zrušiť");//429 je ID.. nezabudni dať iné ako si už použil, aby sa ti to potom nebugovalo
}
return 1;
}
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
if(dialogid == 111)// tu ID dialogu
{
if(response == 1) // ľavé tlačítko, pre pravé daj 0
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 164);//z dejchakem
}
else if(listitem == 1)
{
SetPlayerSkin(playerid, 168);//bez dejchaku
}
else if(listitem == 2)
{
GivePlayerWeapon(playerid, 43,500); //Fotak
}
else if(listitem == 3)
{
GivePlayerWeapon(playerid, 23,100); // zbran 1
}
else if(listitem == 4)
{
GivePlayerWeapon(playerid, 34,100); //zbran 2
}
}
}
//////////////////////// TU DÁŠ druhé.. a tak môžeš pridávať viac
if(dialogid == 429)// tu ID dialogu // použijeme to, ktoré sme už použli
{
if(response == 1) // ľavé tlačítko, pre pravé daj 0
{
if(listitem == 0)
{
SetPlayerSkin(playerid, 164);//z dejchakem
}
else if(listitem == 1)
{
SetPlayerSkin(playerid, 168);//bez dejchaku
}
else if(listitem == 2)
{
GivePlayerWeapon(playerid, 43,500); //Fotak
}
else if(listitem == 3)
{
GivePlayerWeapon(playerid, 23,100); // zbran 1
}
else if(listitem == 4)
{
GivePlayerWeapon(playerid, 34,100); //zbran 2
}
}
}
// TU môžeš vložiť ďalšie a potom zas a zas
return 1;
}

 

Rýchlo som to spravil, tak keby, že nájdeš chybu povedz, opravíme ;-)

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...