I need help
#1

I'm trying to make so when a player connects to the server, when they spawn, they have to agree to the rules, and if they don't, it kicks them, but only the first half of it works.. I'm clueless xD

pawn Код:
if(response)
    {
        switch(dialogid)
        {
            case 1244:
            {
                if(response)
                {
                    SendClientMessage(playerid, COLOR_RED, "You've agreed to the terms and conditions, failure to comply with them will get you banned");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "You've declined the rules, you have been disconnected");
                    Kick(playerid);
                }
                return 1;
            }
Reply
#2

pawn Код:
if(response) // < This is the reason
    {
        switch(dialogid)
        {
            case 1244:
            {
                if(response)
                {
                    SendClientMessage(playerid, COLOR_RED, "You've agreed to the terms and conditions, failure to comply with them will get you banned");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "You've declined the rules, you have been disconnected");
                    Kick(playerid);
                }
                return 1;
            }
Hope thats enough help
Reply
#3

pawn Код:
if(response)
    {
        switch(dialogid)
        {
            case 1244:
            {
                if(response) return SendClientMessage(playerid, COLOR_RED, "You've agreed to the terms and conditions, failure to comply with them will get you banned");
                else
                {
                    SendClientMessage(playerid, COLOR_RED, "You've declined the rules, you have been disconnected");
                    Kick(playerid);
                }
                return 1;
            }
Reply
#4

Still not working, It doesn't make any sense o.o
Reply
#5

So CoDeZ.. what's the point to post the same thing?



Try now.
pawn Код:
switch(dialogid)
    {
       case 1244:
       {
          if(response) return SendClientMessage(playerid, COLOR_RED, "You've agreed to the terms and conditions, failure to comply with them will get you banned");
          else SendClientMessage(playerid, COLOR_RED, "You've declined the rules, you have been disconnected"),Kick(playerid);
          return 1;
       }
    }
Reply
#6

What do you mean by "but only the first half of it works.."?
Reply
#7

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
What do you mean by "but only the first half of it works.."?
That, only the first half works, clicking agree says you've agreed to the terms, but when you click decline, nothing happens..
Reply
#8

It seems that you didnt understood my first post, so I explain it in more depth
pawn Код:
//
    if(response) // First you check if he responded
    { // everything here only works if the player agreed!
        switch(dialogid)
        {
            case 1244:
            {
                if(response) // you check again if he agreed
                { // but we already know that he agreed through the first check
                    SendClientMessage(playerid, COLOR_RED, "You've agreed to the terms and conditions, failure to comply with them will get you banned");
                }
                else // this will never happen because the player already agreed
                {
                    SendClientMessage(playerid, COLOR_RED, "You've declined the rules, you have been disconnected");
                    Kick(playerid);
                }
                return 1;
            }
            // other cases
        }
    } // till here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)