/warn Commmand
#8

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
pawn Код:
#define DIALOG_WARN 1
We need the dialog for the warning text you will use.

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
playerid = You;
clickedplayerid = The player you clicked.
source(not needed in this case) = of couurse the scoreboard;

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
        if(PlayerInfo[playerid][pAdmin] >=1)
       {
          ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"WarnText","Please type your warning reason here","Submit","Cancel"); // this will show you a dialog(like the one for register system,where you type in a password,but instead,you'll type here the warning reason)
       }
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid==DIALOG_WARN) // our dialog defined above at the beggining of my reply
   {
       if(response==0) return SendClientMessage(playerid,COLOR_RED,"Operation aborted"); // you selected cancel
       if(response==1)
       {
           if(!strlen(inputtext)) return SendClientMessage(playerid,COLOR_RED,"You didn't type anything in the box"); // you typed no text,no warning reason
           if(strlen(inputtext)) // you typed in a reason
          {        
             new pID=clickedplayerid; // the player id you wanna give the warn
             new wName[MAX_PLAYER_NAME]; // you can call this as you wish,but I though of wName( warned name)
            GetPlayerName(pID,wName,sizeof(wName)); // gets the pID name
            new string[120]; // the string we gonna use for the warning statement
            format(string,sizeof(string),"%s(%d) has been warned by an admin.Reason:%s",wName,pID,inputtext); // the statement itself sending the warned name,his ID,and the reason
            SendClientMessageToAll(COLOR_RED,string); // the message is sent to every player
          }
   return true;
}
I don't really know if that works,but it should,you know the only thing I'm not sure about is if the system can read the pID as the clickedplayerid,so if you have some problems,than maybe some1 else will try to help you by correcting my post.
Thanks It Works! ..
But I Wont After 3 Warning He Get Kick How I Can Do that?
Reply


Messages In This Thread
/warn Commmand - by V_LOPE - 30.09.2011, 17:58
Re: /warn Commmand - by V_LOPE - 01.10.2011, 02:43
Re: /warn Commmand - by Yamoo - 01.10.2011, 02:44
Re: /warn Commmand - by Super_Panda - 01.10.2011, 03:02
Re: /warn Commmand - by grand.Theft.Otto - 01.10.2011, 04:12
Re: /warn Commmand - by V_LOPE - 01.10.2011, 04:26
Re: /warn Commmand - by Cjgogo - 01.10.2011, 06:23
Re: /warn Commmand - by V_LOPE - 01.10.2011, 07:42
Re: /warn Commmand - by Jafet_Macario - 01.10.2011, 07:46
Re: /warn Commmand - by V_LOPE - 01.10.2011, 08:31

Forum Jump:


Users browsing this thread: 5 Guest(s)