SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/01/2013, 03:14 PM   #1
SilverKiller
Gangsta
 
SilverKiller's Avatar
 
Join Date: Nov 2012
Location: =>space<=
Posts: 626
Reputation: 56
Default Dialog Problem

FIXED!
__________________
I'm working on an admin system called skAdmin, 40% finished.


Scripting simple admin systems with some commands for free, PM me for more info.

I also need testers for my skAdmin filterscript, if you want to test, you are welcome!, just send me a pm.

Quote:
Originally Posted by cessil View Post
I quit school and became a professional sa-mp player
Guys, if i helped anyone incorrectly, please correct me, thank you.

Last edited by SilverKiller; 23/01/2013 at 04:23 PM.
SilverKiller is offline   Reply With Quote
Old 23/01/2013, 03:33 PM   #2
Blackazur
High-roller
 
Join Date: Apr 2012
Posts: 1,407
Reputation: 12
Default AW: Dialog Problem

Try:

Code:
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid); 
}
return 1;
}

return 0;
Blackazur is offline   Reply With Quote
Old 23/01/2013, 03:37 PM   #3
SilverKiller
Gangsta
 
SilverKiller's Avatar
 
Join Date: Nov 2012
Location: =>space<=
Posts: 626
Reputation: 56
Default Re: AW: Dialog Problem

Quote:
Originally Posted by Blackazur View Post
Try:

Code:
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid); 
}
return 1;
}

return 0;
Not working
__________________
I'm working on an admin system called skAdmin, 40% finished.


Scripting simple admin systems with some commands for free, PM me for more info.

I also need testers for my skAdmin filterscript, if you want to test, you are welcome!, just send me a pm.

Quote:
Originally Posted by cessil View Post
I quit school and became a professional sa-mp player
Guys, if i helped anyone incorrectly, please correct me, thank you.
SilverKiller is offline   Reply With Quote
Old 23/01/2013, 03:38 PM   #4
coakiddo
Big Clucker
 
coakiddo's Avatar
 
Join Date: Nov 2012
Posts: 56
Reputation: 32
Default Re: Dialog Problem

Code:
if(dialogid == DIALOG_RULES)
    {
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
            Kick(playerid);
        }
        else if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
        }
        return 1;
    }
Try this, I'm not sure if it works.
coakiddo is offline   Reply With Quote
Old 23/01/2013, 03:41 PM   #5
SilverKiller
Gangsta
 
SilverKiller's Avatar
 
Join Date: Nov 2012
Location: =>space<=
Posts: 626
Reputation: 56
Default Re: Dialog Problem

Quote:
Originally Posted by coakiddo View Post
Code:
if(dialogid == DIALOG_RULES)
    {
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
            Kick(playerid);
        }
        else if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
        }
        return 1;
    }
Try this, I'm not sure if it works.
Still not working, No already works fine, but when i click yes nothing happens it only gets me to the skin selection and it should send a client message

EDIT: I also tried to put it under OnPlayerSpawn (i have it under OnPlayerConnect) but OnPlayerSpawn Does the same thing, it doesnt get me to the class selection, it only does nothing.
__________________
I'm working on an admin system called skAdmin, 40% finished.


Scripting simple admin systems with some commands for free, PM me for more info.

I also need testers for my skAdmin filterscript, if you want to test, you are welcome!, just send me a pm.

Quote:
Originally Posted by cessil View Post
I quit school and became a professional sa-mp player
Guys, if i helped anyone incorrectly, please correct me, thank you.
SilverKiller is offline   Reply With Quote
Old 23/01/2013, 03:51 PM   #6
SilverKiller
Gangsta
 
SilverKiller's Avatar
 
Join Date: Nov 2012
Location: =>space<=
Posts: 626
Reputation: 56
Default Re: Dialog Problem

Any solution?
__________________
I'm working on an admin system called skAdmin, 40% finished.


Scripting simple admin systems with some commands for free, PM me for more info.

I also need testers for my skAdmin filterscript, if you want to test, you are welcome!, just send me a pm.

Quote:
Originally Posted by cessil View Post
I quit school and became a professional sa-mp player
Guys, if i helped anyone incorrectly, please correct me, thank you.
SilverKiller is offline   Reply With Quote
Old 23/01/2013, 04:03 PM   #7
SilverKiller
Gangsta
 
SilverKiller's Avatar
 
Join Date: Nov 2012
Location: =>space<=
Posts: 626
Reputation: 56
Default Re: Dialog Problem

Oh, and i forgot, i have another Dialog with another ID, but the dialog works fine and is not bugged, here is the code for both dialogs

pawn Code:
#define DIALOG_RULES 2
    ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYLE_MSGBOX,"Server Rules!","No Cheating\n- No Spamming\n- Respect Admins\n\nDo you agree to these rules?","Yes","No"); // under on player connect

pawn Code:
}
    if(!strcmp(cmdtext, "/drinks", true))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Drinks For Only 1 , 2 ,3 $", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
        return 1;

Now OnDialogResponse For both:

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case 1:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -1);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                    }
                    case 1:
                    {
                        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -2);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                    }
                    case 2:
                    {
                        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -3);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                    }
               }
           }
        }
        return 1;
   
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    }
    if(dialogid == DIALOG_RULES)
    {
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
            Kick(playerid);
        }
        else if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); //problem
        }
        return 1;
    }
   
    return 0;
}

Compiles with no errors, but still not working, also tried to make it else only, still nothing happens
__________________
I'm working on an admin system called skAdmin, 40% finished.


Scripting simple admin systems with some commands for free, PM me for more info.

I also need testers for my skAdmin filterscript, if you want to test, you are welcome!, just send me a pm.

Quote:
Originally Posted by cessil View Post
I quit school and became a professional sa-mp player
Guys, if i helped anyone incorrectly, please correct me, thank you.
SilverKiller is offline   Reply With Quote
Old 23/01/2013, 04:06 PM   #8
coakiddo
Big Clucker
 
coakiddo's Avatar
 
Join Date: Nov 2012
Posts: 56
Reputation: 32
Default Re: Dialog Problem

Code:
switch(dialogid)
{
    case 1: // /drink dialog
    {
        // Code here
    }
    case 2: // Rules Dialog
    {
        // Code here
    }
}
Use it like this, you really messed up that code.
coakiddo is offline   Reply With Quote
Old 23/01/2013, 04:15 PM   #9
SilverKiller
Gangsta
 
SilverKiller's Avatar
 
Join Date: Nov 2012
Location: =>space<=
Posts: 626
Reputation: 56
Default Re: Dialog Problem

Wait, i fixed it!

I removed the return 1; at the end of the drinks dialog and now they both work
__________________
I'm working on an admin system called skAdmin, 40% finished.


Scripting simple admin systems with some commands for free, PM me for more info.

I also need testers for my skAdmin filterscript, if you want to test, you are welcome!, just send me a pm.

Quote:
Originally Posted by cessil View Post
I quit school and became a professional sa-mp player
Guys, if i helped anyone incorrectly, please correct me, thank you.
SilverKiller 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
Login Dialog problem - dialog too small Saddin Scripting Help 3 19/08/2012 03:58 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
[REP+] Dialog problem, case 1 causing errors, case 2 and 3 works fine, cant find problem niels44 Scripting Help 0 21/04/2012 06:44 PM
Dialog Problem +rep N0FeaR Scripting Help 4 31/01/2012 06:02 PM
On Dialog : Problem.. g@k Help Archive 0 02/04/2010 04:58 PM


All times are GMT. The time now is 04:58 PM.


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