22.12.2014, 15:10
(
Последний раз редактировалось Luicy.; 22.12.2014 в 17:13.
)
Tutorial
Hello. Today i gonna Teach you how to make ZCMD's.
First Start at top With the includes.
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
Okay. Now lets do 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
Before
We gonna add this:
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
We gonna add params
also
And now it would show: [OOC]Carl_Meller: Text
Also Now your done! Gz.
Sorry for my bad english i Got Dyslexia.
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.
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.
pawn Код:
COMMAND:o(playerid, params[]) // This makes the command /o
{
// The functions will come here.
return 1; // This and
} // This finishes the command.
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.
pawn Код:
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME]; //Making so it wont say Undefined symbol Name.
pawn Код:
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED,"Use: /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:
also
pawn Код:
format(string, sizeof(string), "[OOC]%s: %s ", name, params);
Also Now your done! Gz.
Sorry for my bad english i Got Dyslexia.