how can i make stocks for shorter commands?
#1

for example for "SendClientMessage(playerid,Color,Message)"
to make it "Msg(playerid,color,message)"

ShowPlayerDialog(playerid,DialogID,Dialog Style,"Title","Msg","Btn1","Btn2")

Dialog(playerid,DialogID,Dialog Style,"Title","Msg","Btn1","Btn2")

And for:
DOF2_GetInt(pFile(playerid),"X");

GetInt(playerid,"X");

same for SetInt
Reply
#2

its basicly changing the name if you want it that way:

pawn Код:
stock Msg(playerid,color,message[])
{
       SendClientMessage(playerid,color,message);
       return 1;
}
Reply
#3

LOL yea thats probably better XD
Reply
#4

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
No need for stocks, just define them;

pawn Код:
#define Dialog ShowPlayerDialog
#define GetInt DOF2_GetInt
#define Msg SendClientMessage
OMG I feel so noob xD
HOW COULD I FORGET IT
Reply
#5

Might I suggest enrolling in a typing course? I, for one, find it extremely annoying to read shortened functions, just because the creator of the script is too lazy to type it out (or to use Search & Replace, for that matter).
Reply
#6

pawn Код:
#define Dialog(%0) ShowPlayerDialog(%0)
#define GetInt(%0) DOF2_GetInt(%0)
#define Msg(%0) SendClientMessage(%0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)