[Tutorial] "Welcome to my Server" Message
#1

Hey, how's everybody doing? In this BEGINNER FRIENDLY tutorial, I will teach you how to send a welcome message to a player of your server.For this Tutorial you just need to know some Basic Pawno!

__________________________________________

Step 1. Ontop of the script, we'll need to introduce we wish the message to be. In this case, I'll be using GREENYELLOW, but you can choose your own color here. For that, we'll need to define the color. I'll show you how to define a color:

Code:
#define COLOR_YELLOWGREEN 0xADFF2FAA
NOTE: If you're using another color, keep #define and change the rest with the desired color.

Step 2. Now, for the welcome message, we'll need to introduce the public function 'OnPlayerConnect'. We do it like this:

Code:
public OnPlayerConnect
Step 3. After introducing the public function, we need to introduce "(playerid)", because we're going to send a message to a player. It's pretty basic:


Code:
public OnPlayerConnect(playerid)
Step 4.Easy so far? Now, we need to introduce the function "SendClientMessage", which sends a message to a player. You can read more about this function here.


Code:
public OnPlayerConnect(playerid)
{
  SendClientMessage
Step 4.1. However, SendClientMessage has parameters you need to include. These parameters are as follows:
playerid The playerid you would like to display the message for.
color The color it should be in.
const message[] The text you would like to display. max len displayable: 144

Code:
SendClientMessage(playerid, color, const message[]);
Everything you need to change is color to the colour you defined and the const message[] to 'Welcome to my server'.

Step 5. You now need to include the parameters on SendClientMessage and add edit them.


Code:
public OnPlayerConnect(playerid)
{
  SendClientMessage(playerid, COLOR_YELLOWGREEN, "Welcome to my server! Hope you enjoy your stay around here!");
Step 6. Now, since we want the message to be sent to the player, we need to add a return. Since we want it to be sent, the return as to be 1. So this is our final code:


Code:
public OnPlayerConnect(playerid)
{
  SendClientMessage(playerid, COLOR_GREENYELLOW, "Welcome to my server! Hope you enjoy your stay around here!");
  return 1;
}
__________________________________________

Hope All The LAD's think this will be helpfull!
Thnks alot if you +rep me
I hope i helped People!
Reply
#2

Really?
Reply
#3

Too easy for a tutorial, but well explained, good work. Do something more difficult next time.
Reply
#4

It may be a 'beginner' tutorial, but if you just read the wiki before going to make a gamemode (Which everyone imo should do) this 'tutorial' is rendered useless as you can see easily how to make one at: https://sampwiki.blast.hk/wiki/SendClientMessage From that last part it just makes it look like you want +rep because nobody should just give out rep for example usage of one function that is easily shown on the wiki.
Reply
#5

Quote:

Hey, how's everybody doing? In this BEGINNER FRIENDLY tutorial, I will teach you how to send a welcome message to a player of your server.For this Tutorial you just need to know some Basic Pawno!

This a very bad way of trying to earn a rep You are making Tutorials on anything Make a useful tutorial Man!
Reply
#6

Too simple man... try something else..
Reply
#7

too much simple tutorial...
Reply
#8

All you do here is show us the public OnplayerConnect(playerid) callback, tell us how the function SendClientMessage works and the return 1;
It isn't just simple and easy, I wouldN't even bother calling it a tutorial
Reply
#9

LoL you type this much on a waste piece of shit

its not worth Making a Thread
Go Earn some reps with useful shit not with this crap
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)