SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/05/2019, 01:54 PM   #1
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 310
Reputation: 13
Default Dialogs

solved

Last edited by Jaua10; 31/05/2019 at 01:44 PM.
Jaua10 is offline   Reply With Quote
Old 30/05/2019, 02:06 PM   #2
LowIQ
Little Clucker
 
Join Date: May 2019
Posts: 21
Reputation: 5
Default Re: Dialogs

error 002: only a single statement (or expression) can follow each "case"

Check every case and make sure you use it properly.
So the script know what happend

if (!response)
//your code

if(response)
//your code

Like this:
Code:
        
case DIALOG_TEST:
{
            if(!response)
            {
            
            	Kick(playerid);
                //yourcode
            }
            if(response)
            {

             ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Your dialog name","Your 
             Text","Ok","Exit");
             //yourcode

            }
}
for sure u can use !response like this too:

Code:
if(!response) return Kick(playerid);

warning 209: function "S@@_OnDialogResponse" should return a value

Add
Code:
return 1;
on the end of function OnDialogResponse

warning 203: symbol is never used: "SendMessage"

This is caused because u never use function SendMessage wich is defined in your code.
You can delete this SendMessage function and when u need just use default pawn function
SendClientMessage.
LowIQ is offline   Reply With Quote
Old 30/05/2019, 02:27 PM   #3
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 310
Reputation: 13
Default Re: Dialogs

I cant ifne the errors, also i have the same in other gm and works perfectly and i just move this dialogs and still giving me this warnings and erros
Jaua10 is offline   Reply With Quote
Old 30/05/2019, 03:11 PM   #4
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 22
Default Re: Dialogs

You have a return 1; inside switch but outside any case which throws error 002.
Code:
//You have:
switch(someVariable)
{
   case 0: 
   {
      //DoStuff
   }
   return 1; //<--- throws error 002, not inside case
}
//Correct:
switch(someVariable)
{
   case 0:
   {
      //DoStuff
      return 1;
   }
}
Plastikmensch is offline   Reply With Quote
Old 30/05/2019, 03:19 PM   #5
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 310
Reputation: 13
Default Re: Dialogs

solved

Last edited by Jaua10; 31/05/2019 at 01:44 PM.
Jaua10 is offline   Reply With Quote
Old 30/05/2019, 03:33 PM   #6
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 22
Default Re: Dialogs

I did.
Code:
case DIALOG_ISFROM: 
        { 
            if(!response) return ShowDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "{0092FF}¿Cual es tu genero?", "{FFFFFF}Femenino\nMasculino\nOtros", "Siguiente", "Volver", 
                                                                                           "{0092FF}¿What do you want your character's gender to be?", "{FFFFFF}Female\nMale\nOthers", "Next", "Back"); 

            ShowDialog(playerid, DIALOG_TUTO, DIALOG_STYLE_MSGBOX, "{0092FF}Turorial", "{FFFFFF}Procederemos a mostrarte un tutorial", "Acepto", "", 
                                                                   "{0092FF}Turorial", "{FFFFFF}We will proceed to show you a tutorial", "Accept", ""); 
        } //closing bracket case DIALOG_ISFROM
    return 1; <- There 
    } //closing switch
   //return 1; should be here
//} closing OnDialogRespone here
Plastikmensch is offline   Reply With Quote
Old 30/05/2019, 03:50 PM   #7
Jaua10
Huge Clucker
 
Join Date: Apr 2011
Posts: 310
Reputation: 13
Default Re: Dialogs

Quote:
Originally Posted by Plastikmensch View Post
I did.
Code:
case DIALOG_ISFROM: 
        { 
            if(!response) return ShowDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "{0092FF}¿Cual es tu genero?", "{FFFFFF}Femenino\nMasculino\nOtros", "Siguiente", "Volver", 
                                                                                           "{0092FF}¿What do you want your character's gender to be?", "{FFFFFF}Female\nMale\nOthers", "Next", "Back"); 

            ShowDialog(playerid, DIALOG_TUTO, DIALOG_STYLE_MSGBOX, "{0092FF}Turorial", "{FFFFFF}Procederemos a mostrarte un tutorial", "Acepto", "", 
                                                                   "{0092FF}Turorial", "{FFFFFF}We will proceed to show you a tutorial", "Accept", ""); 
        } //closing bracket case DIALOG_ISFROM
    return 1; <- There 
    } //closing switch
   //return 1; should be here
//} closing OnDialogRespone here
it works pal, thank alot, i have another question how can i do if i ant to set a skin when player sleect the gender female and male?
Jaua10 is offline   Reply With Quote
Old 30/05/2019, 04:16 PM   #8
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 22
Default Re: Dialogs

Use SetPlayerSkin? https://wiki.sa-mp.com/wiki/SetPlayerSkin
You could also just let people choose their skin regardless of gender.
There is also a snippet in the forum which stores the gender of skin ids and you could use that to create a gender based skin selection if you want to use more than 2 skins.
Plastikmensch 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
[Include] Alternative Dialogs - Dialogs with the new design OstGot Includes 40 16/12/2017 11:06 PM
[FilterScript] Items spawner dialogs (zcmd & dialogs include) Q_Lite Filterscripts 17 16/10/2016 11:09 AM
A few errors I cannot see what I have done wrong. - Dialogs and Dialogs I guess... Deal-or-die Scripting Help 2 14/08/2012 05:35 PM
[Include] Callback Dialogs (Faster processing dialogs) clavador Includes 2 06/07/2011 10:59 AM


All times are GMT. The time now is 05:36 AM.


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