define dialog help
#1

any know whats the problem here, thanks in advance!

Код:
C:\Users\Jeffner\Desktop\BaseNorton V2\gamemodes\Gamemode.pwn(663) : error 040: duplicate "case" label (value 5)
Код:
#define DIALOG_RP 5
PHP код:
case DIALOG_RP:
                        {
                            switch(
response)
                            {
                                case 
1// Selecting
                                
{
                                    switch(
listitem)
                                    {
                                        case 
0// Selecting
                                        
{
                                            
Kick(playerid);
                                        }
                                        case 
1// Selecting
                                        
{
                                            
ShowPlayerDialog(playerid,DIALOG_RP,DIALOG_STYLE_LIST,"What does RP stand for?","{33FF66}Rolepole\n{33FF66}Roleplay\n{33FF66}Rolepool""Select""Leave");
                                        }
                                        case 
2// Selecting
                                        
{
                                            
Kick(playerid);
                                            return 
1
Reply
#2

pawn Код:
case 1: // Selecting
                                {
                                    switch(listitem)
                                    {
                                        case 0: // Selecting
                                        {
                                            Kick(playerid);
                                        }
                                        case 1: // Selecting
Check the first and last lines of this code.
Reply
#3

Use like this:

PHP код:
if(dialogid == DIALOG_RP)
{
    if(!
response)return 1//Cancel button
    
if(response)
    {
        
//your codes 
Reply
#4

Quote:
Originally Posted by DeathCore
Посмотреть сообщение
Use like this:

PHP код:
if(dialogid == DIALOG_RP)
{
    if(!
response)return 1//Cancel button
    
if(response)
    {
        
//your codes 
Do not do that, your code is much more efficient. Just change the 5 in the define to another number, like 45 or something, you should then be okay.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)