[Tutorial] How to Make ZCMD's
#1

Tutorial
Hello. Today i gonna Teach you how to make ZCMD's.

First Start at top With the includes.

pawn Код:
#include <a_samp> // This is the orginal Include that contains all the Pawn Commands in SAMP Wiki
#include <sscanf> // This is just to look up errors.
#include <zcmd> // Heres the Self Command prossesor.
Read the // Text for the information.
Okay now we gonna Define colors. Im Using SAMP Color Picker.
So lets take.
COLOR_RED For the errors. And WHITE We dont need any Define becuse White is -1 Automatic, But if you want to use your own edited White color so Just use COLOR_WHITE
pawn Код:
#define COLOR_RED 0xFF0000FF // Red Color using SAMP Color Picker.
#define COLOR_WHITE 0xF5F5F5FF // White Color Using SAMP Color Picker.
Okay. Now lets do the Command.
pawn Код:
COMMAND:o(playerid, params[]) // This makes the command /o
{
    // The functions will come here.
return 1; // This and
} // This finishes the command.
Alright Now we gonna add GetPlayerName More about GetPlayer Name is on the link. Its simple It just Gets the player Name.
So now we gonna add
pawn Код:
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME]; //Making so it wont say Undefined symbol Name.
    GetPlayerName(playerid, name, sizeof(name)); // Getting the player Name of Sender.
 
    format(string, sizeof(string), "[OOC]%s: ", name); // The message that gonna be shown. Also [OOC]Carl_Meller:
    SendClientMessageToAll(COLOR_WHITE, string); // This sends the message to everyone.
Before
pawn Код:
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME]; //Making so it wont say Undefined symbol Name.
We gonna add this:
pawn Код:
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED,"Use: /o Text.");
That looks if you typed /o Text
or just /o, If you just writed /o It will say Use: /o Text.
Now we gonna add the "params" also the Text so it wouldnt just be [OOC]Carl_Meller:
So it would be [OOC]Carl_Meller: Text will come here
So at
pawn Код:
format(string, sizeof(string), "[OOC]%s: ", name); // The message that gonna be shown. Also [OOC]Carl_Meller:
We gonna add params
also
pawn Код:
format(string, sizeof(string), "[OOC]%s: %s ", name, params);
And now it would show: [OOC]Carl_Meller: Text
Also Now your done! Gz.
Sorry for my bad english i Got Dyslexia.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)