15.06.2014, 09:54
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:
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:
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:
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.
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
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.
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:
__________________________________________
Hope All The LAD's think this will be helpfull!
Thnks alot if you +rep me
I hope i helped People!
__________________________________________
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
Step 2. Now, for the welcome message, we'll need to introduce the public function 'OnPlayerConnect'. We do it like this:
Code:
public OnPlayerConnect
Code:
public OnPlayerConnect(playerid)
Code:
public OnPlayerConnect(playerid) { SendClientMessage
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[]);
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!");
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!