SA-MP Forums Archive
how can i make stocks for shorter commands? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how can i make stocks for shorter commands? (/showthread.php?tid=524985)



how can i make stocks for shorter commands? - Lirbo - 09.07.2014

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


Re: how can i make stocks for shorter commands? - AIped - 09.07.2014

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

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



Re: how can i make stocks for shorter commands? - AIped - 09.07.2014

LOL yea thats probably better XD


Re: how can i make stocks for shorter commands? - Lirbo - 09.07.2014

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


Re: how can i make stocks for shorter commands? - Vince - 09.07.2014

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).


Re: how can i make stocks for shorter commands? - Dubya - 09.07.2014

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