SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/07/2012, 10:52 PM   #1
Youtube12
Huge Clucker
 
Join Date: Apr 2012
Posts: 220
Reputation: -5
Default How to Respawn Dialog

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 Youtube12.
Youtube12 is offline   Reply With Quote
Old 15/07/2012, 10:54 PM   #2
Toreno
Gangsta
 
Join Date: Nov 2010
Posts: 725
Reputation: 41
Default Re: How to Respawn Dialog

When a player chooses a weapon he wants to buy, don't just give him the weapon but re-show him the dialog.
pawn Code:
ShowPlayerDialog(...);

EDIT: Just copy this dialog you're using once a player types a command to open this dialog.
Toreno is offline   Reply With Quote
Old 15/07/2012, 11:42 PM   #3
Youtube12
Huge Clucker
 
Join Date: Apr 2012
Posts: 220
Reputation: -5
Default AW: How to Respawn Dialog

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.
Youtube12 is offline   Reply With Quote
Old 16/07/2012, 03:15 AM   #4
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 738
Reputation: 138
Default Re: How to Respawn Dialog

pawn Code:
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;
}
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 16/07/2012, 11:38 AM   #5
Youtube12
Huge Clucker
 
Join Date: Apr 2012
Posts: 220
Reputation: -5
Default AW: Re: How to Respawn Dialog

Quote:
Originally Posted by [MM]RoXoR[FS] View Post
pawn Code:
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.
Youtube12 is offline   Reply With Quote
Old 16/07/2012, 11:44 AM   #6
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 738
Reputation: 138
Default Re: AW: Re: How to Respawn Dialog

Quote:
Originally Posted by Youtube12 View Post
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
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 16/07/2012, 12:07 PM   #7
Youtube12
Huge Clucker
 
Join Date: Apr 2012
Posts: 220
Reputation: -5
Default AW: Re: AW: Re: How to Respawn Dialog

Quote:
Originally Posted by [MM]RoXoR[FS] View Post
Show your OnDialogResponse
Code:
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;
	}
Youtube12 is offline   Reply With Quote
Old 16/07/2012, 12:20 PM   #8
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 738
Reputation: 138
Default Re: How to Respawn Dialog

pawn Code:
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);
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 16/07/2012, 12:28 PM   #9
Andi_Evandy
Big Clucker
 
Join Date: Nov 2011
Location: Indonesia
Posts: 125
Reputation: 23
Default Re: How to Respawn Dialog

pawn Code:
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;
    }
Andi_Evandy is offline   Reply With Quote
Old 16/07/2012, 12:33 PM   #10
Youtube12
Huge Clucker
 
Join Date: Apr 2012
Posts: 220
Reputation: -5
Default AW: Re: How to Respawn Dialog

Quote:
Originally Posted by [MM]RoXoR[FS] View Post
pawn Code:
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 ..
Youtube12 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM
Big problem (PlayerDialogResponse PlayerId: 57 dialog ID doesn't match last sent dialog ID) RingoRus Server Support 3 12/06/2012 05:54 PM
Dialog response not Sending Message [Input Dialog] Deal-or-die Scripting Help 8 08/05/2012 01:10 PM
[PEDIDO] Dialog em Spawn e Dialog ao Entrar no veículo ViCtOr_Mc Português/Portuguese 8 27/05/2011 05:13 PM
how to respawn the player pos ? respawn(playerid); ?[solved] AlbanianGuy Help Archive 3 24/04/2010 02:22 AM


All times are GMT. The time now is 02:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.