19.02.2014, 17:21
Hey,
I saw many of newbie's looking for command like this as shown in the photo, Some of them didn't tried to make or under stand its functions, Well most of them have already known its functions. Example:- Well to let you know that its simple as hell . Here we are going to use the command /me. Normally /me will change into our/your name For example Typing this is chat:-
/me: is now posting on sa-mp forums.
The text will appear like this:- [vTc]Patroool is now posting on sa-mp forums.
This codes will come under:
Creating a string.
Will get the player name, Who is typing.
Format of the command, Like i said above (*[vTc]Patroool is <ACTION>)
Will send message to all players, With the format above. Currently the colour is WHITE (0xFFFF00AA).
Well, Thats all Your command is ready!
It was a quick tutorial, So when the newbie use the Search button they would see this tutorial
*If you want colour's list you can get here (COLOURS)
I saw many of newbie's looking for command like this as shown in the photo, Some of them didn't tried to make or under stand its functions, Well most of them have already known its functions. Example:- Well to let you know that its simple as hell . Here we are going to use the command /me. Normally /me will change into our/your name For example Typing this is chat:-
/me: is now posting on sa-mp forums.
The text will appear like this:- [vTc]Patroool is now posting on sa-mp forums.
So Let's begin!
This codes will come under:
Code:
public OnPlayerCommandText(playerid, cmdtext[]) {
- 1)
Code:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s is %s", str, cmdtext[4]); SendClientMessageToAll(0xFFFF00AA, str); return 1; } return 0; }
Functions
Code:
new str[128];
Code:
GetPlayerName(playerid, str, sizeof(str));
Code:
format(str, sizeof(str), "* %s is %s", str, cmdtext[4]);
Code:
SendClientMessageToAll(0xFFFF00AA, str);
Well, Thats all Your command is ready!
It was a quick tutorial, So when the newbie use the Search button they would see this tutorial
*If you want colour's list you can get here (COLOURS)
+rep please Dont mind
And please comment. Thank you very much!
And please comment. Thank you very much!