[Tutorial] How to make a simple /credits command
#1

Hello, This is my very first tutorial. I am a beginner at scripting. Also, Thought to make a tutorial on how to create a /credits command.
Requirements:
  1. Your fav colors.
  2. Pawno
Steps:

1. Open Pawno
2. File> New
3. Locate
pawn Код:
if(strcmp("/mycommand", cmdtext, true) == 0)
in pawno.
4. Find your fav color and put it after includes like

pawn Код:
#include <a_samp>
#define COLOR_ORANGE 0xFF9900AA
5. Change /mycommand to /credits or whatever you want your command to show credits as this is going to be the command that will be used by player to see the credits.
6. remove
pawn Код:
//Do something here
7. Put this code here
pawn Код:
SendClientMessage(playerid, YOUR_COLOR, "ME FOR THIS TUTORIAL");
(This will send the player your message that you entered.)
8. Change YOUR_COLOR and put the color you defined at the top , If you choosed the color same as me, Then use this

pawn Код:
SendClientMessage(playerid, COLOR_ORANGE, "ME FOR THIS TUTORIAL");
9. Compile and run
10. Add your FS in server.cfg
10.Type your command in game and done !
Reply
#2

First of all, i don't think someone who is a beginner should write tutorials...

Second, it's the very basics, so i say "useless tutorial".
Reply
#3

The problem is that you did not explain anything. Tutorials are written for a reason - teach people how to do something. By copying-pasting the text, nobody is going to learn.
Reply
#4

Explained a little more
Thanks for feedback.
Tell me if more needed
Reply
#5

It's better now, a bit more interesting to read. Even though it's probably the most simplest thing you can do to create a credits command or a command that returns some text.
Reply
#6

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
It's better now, a bit more interesting to read. Even though it's probably the most simplest thing you can do to create a credits command or a command that returns some text.
Thanks for the feedback sir.
Reply
#7

As a begineer it is nice try... I mean well done ... There are many persons or member who doesn't know anything about pawn scripting it can help them to know how to create a simple credits cmd... But next time try to do better explain ... N try to learn more about to pawn to create more useful things .. N i will give you 7/10 as a begineer..
Reply
#8

Its not bad , but you can use ShowPlayerDialog better than sendclient message for example
pawn Код:
CMD:credits(playerid, params[])
{
    ShowPlayerDialog(playerid,DIALOG_CREDITS,DIALOG_STYLE_MSGBOX,"credits","Me for bla bla bla","ok","");
    return 1;
}
Reply
#9

I got stuck on step 5, where is /mycommand :/ also what's YOUR_COLOR it returns an error for me, please help. How to make me have credits :/
Reply
#10

Super simple tutorial 1/10
Reply
#11

@Isolated, /mycommand is on the OnPlayerCommandText call.

If you're using ZCMD, you will need to use:
pawn Код:
CMD:credits(playerid, params[])
{
// the cmd
return 1;
}
And about the YOUR_COLOR, you need to replace it with the code of your chosen color, let's say you chose orange, replace YOUR_COLOR with 0xFF9900AA(Check step .


On topic: It's a really REALLY simple tutorial but might help someone who's new to PAWNO.

Anyway I suggest you get in to the real PAWN business and make other useful tutorials.
Good luck.
Reply
#12

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
@Isolated, [...]
He was joking.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)