[Tutorial] How to make a simple /help and /kill command - NEWBIE FRIENDLY!
#1

Deleted.
Reply
#2

Should also make it a little more advanced by including a dialog box for the command /help but still it's a pretty good tutorial. Also try to explain what is going on, like why you need to define the colours in the first place etc.
Reply
#3

Thanks, will do it in the future.
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(strcmp(cmdtext, "/help", true, 10) == 0)
     {
         new sz_msg [ 900 ];
         strcat( sz_msg, "Welcome to\r\n");
         strcat( sz_msg, "The /help\r\n");
         strcat( sz_msg, "Command\r\n");
         ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "Help", sz_msg, "OK", "Close");
         return 1;
      }
      if(strcmp(cmdtext, "/kill", true, 10) == 0)
      {
          SetPlayerHealth(playerid, 0.0);
          GameTextForPlayer(playerid, "~w~ Wasted!", 4500, 2);
          return 1;
      }
      return 0;
}
Reply
#5

Quote:
Originally Posted by sniperwars
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(strcmp(cmdtext, "/help", true, 10) == 0)
     {
         new sz_msg [ 900 ];
         strcat( sz_msg, "Welcome to\r\n");
         strcat( sz_msg, "The /help\r\n");
         strcat( sz_msg, "Command\r\n");
         ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_MSGBOX, "Help", sz_msg, "OK", "Close");
         return 1;
      }
      if(strcmp(cmdtext, "/kill", true, 10) == 0)
      {
          SetPlayerHealth(playerid, 0.0);
          GameTextForPlayer(playerid, "~w~ Wasted!", 4500, 2);
          return 1;
      }
      return 0;
}
What is your question?
Reply
#6

No problems man
Reply
#7

I have no question, I was showing a way of making the /help command into a dialog.
Reply
#8

Quote:
Originally Posted by JustinAn
Посмотреть сообщение
What is your question?
It's not a question, it's a code of what I said to do. He's created you a dialog box for /help
Reply
#9

Oh alright.
Reply
#10

There are already tons of these tutorials on the forums, and are quite frankly unnecessary.
Tutorials now a days should be made on something other than commands.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)