Need Help with Ignoring Rules
#1

Hey i want when i ignore the rules or player ignore it
there would be a message should sent to all that saying
[SERVER]:Playername Has Been Kick Reason : Ignoring Rules
I try sendmessagetoall on dialogresponse but it crash the game

Heres The Code

OnPlayerCommand

pawn Код:
if(strcmp("/changemycolour", cmdtext, true, 10) == 0)
 {
     if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
     if(GetPVarInt(playerid, "InDm") == 1) return SendClientMessage(playerid,COLOR_RED, "You cant use any command While Your in DM");
     else
     {
     ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Color Name Changer", "Purple\nYellow\nRed\nLightblue\nOrange\nGreen\nIndigo\nPink\nBlack", "Select", "Cancel");
     }
     return 1;
 }
OnDialogResponse

pawn Код:
if(dialogid == 2)
 {
    if(response == 1)
    {
    if(GetPVarInt(playerid,"RulesAccepted")!=1)
    {
         SetPVarInt(playerid,"RulesAccepted",1);
         SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
         GivePlayerMoney(playerid, 50000);
         SendClientMessage(playerid, COLOR_GREEN, "You Accept The Rules You Recieve $500000 + 5 Score Points");
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, "You Already Accepted The Rules");
    }
      }
      else
      {
          SendClientMessage(playerid, COLOR_RED, "You Ignore The Rules");
          SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked!, Reason : Ignoring The Rules");
      Kick(playerid);
      }
      return 1;
 }
Hope you help me
Reply
#2

pawn Код:
if(dialogid == 2)
{
    if(response == 1) {
        if(GetPVarInt(playerid,"RulesAccepted")!=1) {
            SetPVarInt(playerid,"RulesAccepted",1);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
            GivePlayerMoney(playerid, 50000);
            SendClientMessage(playerid, COLOR_GREEN, "You Accept The Rules You Recieve $500000 + 5 Score Points");
        }
        else {
            SendClientMessage(playerid, COLOR_RED, "You Already Accepted The Rules");
        }
    }
    else {
        SendClientMessage(playerid, COLOR_RED, "You Ignore The Rules");
        SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked!, Reason : Ignoring The Rules");
        new name[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s has been kicked for (Denied the rules)",name);
        SendClientMessageToAll(COLOR,string);
            Kick(playerid);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Kitten
Посмотреть сообщение
pawn Код:
if(dialogid == 2)
{
    if(response == 1) {
        if(GetPVarInt(playerid,"RulesAccepted")!=1) {
            SetPVarInt(playerid,"RulesAccepted",1);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
            GivePlayerMoney(playerid, 50000);
            SendClientMessage(playerid, COLOR_GREEN, "You Accept The Rules You Recieve $500000 + 5 Score Points");
        }
        else {
            SendClientMessage(playerid, COLOR_RED, "You Already Accepted The Rules");
        }
    }
    else {
        SendClientMessage(playerid, COLOR_RED, "You Ignore The Rules");
        SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked!, Reason : Ignoring The Rules");
        new name[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s has been kicked for (Denied the rules)",name);
        SendClientMessageToAllCOLOR,string);
            Kick(playerid);
    }
    return 1;
}
Thanks Dude!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)