SA-MP Forums Archive
How to Respawn Dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to Respawn Dialog (/showthread.php?tid=359961)



How to Respawn Dialog - Youtube12 - 15.07.2012

Hi guys,

I know how to make a Dialog but I don't know how to let it Respawn again. I want to know how to make it Respawn everytime.

For example this Video.

Best Regards *******12.


Re: How to Respawn Dialog - Toreno - 15.07.2012

When a player chooses a weapon he wants to buy, don't just give him the weapon but re-show him the dialog.
pawn Код:
ShowPlayerDialog(...);
EDIT: Just copy this dialog you're using once a player types a command to open this dialog.


AW: How to Respawn Dialog - Youtube12 - 15.07.2012

Sure I use ShowPlayerDialog. But when I buy a weapon the dialog not re-showing. I want it to re-showing that what I need.


Re: How to Respawn Dialog - [MM]RoXoR[FS] - 16.07.2012

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch (dialogid)
    {
        case YOUR_DIALOG_ID:
        {
            switch (listitem)
            {
                case 0 :
                {
                    //GiveWeapon
                    ShowPlayerDialog(playerid,YOUR_DIALOG_ID,DIALOG_STYLE_LIST,"Weapons","Brass Knuckes\nAnd SO ON","Buy","Exit");
                }
                case 1:
                {
                    //GiveWeapon
                    ShowPlayerDialog(playerid,YOUR_DIALOG_ID,DIALOG_STYLE_LIST,"Weapons","Brass Knuckes\nAnd SO ON","Buy","Exit");
                }
            }
        }
    }
    return 1;
}



AW: Re: How to Respawn Dialog - Youtube12 - 16.07.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch (dialogid)
    {
        case YOUR_DIALOG_ID:
        {
            switch (listitem)
            {
                case 0 :
                {
                    //GiveWeapon
                    ShowPlayerDialog(playerid,YOUR_DIALOG_ID,DIALOG_STYLE_LIST,"Weapons","Brass Knuckes\nAnd SO ON","Buy","Exit");
                }
                case 1:
                {
                    //GiveWeapon
                    ShowPlayerDialog(playerid,YOUR_DIALOG_ID,DIALOG_STYLE_LIST,"Weapons","Brass Knuckes\nAnd SO ON","Buy","Exit");
                }
            }
        }
    }
    return 1;
}
Yeah its works now but 2 problems.

1.Its dont give the weapons
2.when i press "exit" or "esc" its dont exit or cancel the dialog.


Re: AW: Re: How to Respawn Dialog - [MM]RoXoR[FS] - 16.07.2012

Quote:
Originally Posted by *******12
Посмотреть сообщение
Yeah its works now but 2 problems.

1.Its dont give the weapons
2.when i press "exit" or "esc" its dont exit or cancel the dialog.
Show your OnDialogResponse


AW: Re: AW: Re: How to Respawn Dialog - Youtube12 - 16.07.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
Show your OnDialogResponse
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new string[400], _tmpstring[256], INI:file, filename[WEAPONSHOP], h = GetPVarInt(playerid, "LastCp"), amount =      floatround(strval(inputtext));
        format(filename, sizeof(filename), FILEPATH, h);
	if(dialogid == WEAPONSHOP && response)
	{
	    switch(listitem)
		{
			case 0: SetPlayerHealth(playerid,100);
		        case 1: SetPlayerArmour(playerid,100);
		        case 2: GivePlayerWeapon(playerid,31,1000);
			case 3: GivePlayerWeapon(playerid,34,1000);
		        case 4: GivePlayerWeapon(playerid,26,1000);
			case 5: GivePlayerWeapon(playerid,28,1000);
			case 6: GivePlayerWeapon(playerid,24,1000);
		return 1;
	}



Re: How to Respawn Dialog - [MM]RoXoR[FS] - 16.07.2012

pawn Код:
case 0:
{
SetPlayerHealth(playerid,100);
ShowPlayerDialog(playerid,WEAPONSHOP,DIALOG_STYLE_LIST,"Shop","Add items here","OK","Exit");
}
//Do this for all
case 1: SetPlayerArmour(playerid,100);
case 2: GivePlayerWeapon(playerid,31,1000);        
case 3: GivePlayerWeapon(playerid,34,1000);            
case 4: GivePlayerWeapon(playerid,26,1000);        
case 5: GivePlayerWeapon(playerid,28,1000);
case 6: GivePlayerWeapon(playerid,24,1000);



Re: How to Respawn Dialog - Andi_Evandy - 16.07.2012

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[400], _tmpstring[256], INI:file, filename[WEAPONSHOP], h = GetPVarInt(playerid, "LastCp"), amount =      floatround(strval(inputtext));
    format(filename, sizeof(filename), FILEPATH, h);
    if(dialogid == WEAPONSHOP && response)
    {
        switch(listitem)
        {
            case 0: SetPlayerHealth(playerid,100);
            case 1: SetPlayerArmour(playerid,100);
            case 2: GivePlayerWeapon(playerid,31,1000);
            case 3: GivePlayerWeapon(playerid,34,1000);
            case 4: GivePlayerWeapon(playerid,26,1000);
            case 5: GivePlayerWeapon(playerid,28,1000);
            case 6: GivePlayerWeapon(playerid,24,1000);
        }
        ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "Weapon Shop", "Health\nArmour\netc...", "Buy", "Cancel");
        return 1;
    }



AW: Re: How to Respawn Dialog - Youtube12 - 16.07.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
pawn Код:
case 0:
{
SetPlayerHealth(playerid,100);
ShowPlayerDialog(playerid,WEAPONSHOP,DIALOG_STYLE_LIST,"Shop","Add items here","OK","Exit");
}
//Do this for all
case 1: SetPlayerArmour(playerid,100);
case 2: GivePlayerWeapon(playerid,31,1000);        
case 3: GivePlayerWeapon(playerid,34,1000);            
case 4: GivePlayerWeapon(playerid,26,1000);        
case 5: GivePlayerWeapon(playerid,28,1000);
case 6: GivePlayerWeapon(playerid,24,1000);
So it's work fine for me, thx alot men ..