SA-MP Forums Archive
[Tutorial] How to make a simple /credits command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make a simple /credits command (/showthread.php?tid=462283)



How to make a simple /credits command - hassantariq73 - 06.09.2013

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 !


Re: How to make a simple /credits command - dusk - 06.09.2013

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".


Re: How to make a simple /credits command - Konstantinos - 06.09.2013

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.


Re: How to make a simple /credits command - hassantariq73 - 06.09.2013

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


Re: How to make a simple /credits command - DanishHaq - 06.09.2013

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.


Re: How to make a simple /credits command - hassantariq73 - 06.09.2013

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.


Re: How to make a simple /credits command - PrinceKumar - 07.09.2013

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..


Re: How to make a simple /credits command - SilentSoul - 07.09.2013

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;
}



Re: How to make a simple /credits command - Isolated - 07.09.2013

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 :/


Re: How to make a simple /credits command - ShikamaruSama - 08.09.2013

Super simple tutorial 1/10


Re: How to make a simple /credits command - JimmyCh - 08.09.2013

@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.


Re: How to make a simple /credits command - Konstantinos - 08.09.2013

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