Command define - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command define (
/showthread.php?tid=177812)
Command define -
Typhome - 19.09.2010
How do define it, like:
SendClientMessage(playerid, color, "Hello");
defining into:
SendMessage(playerid, color, "Hello");
?
Re: Command define -
Thebest96 - 19.09.2010
i think u have some includes, but wath is thew problem with SendClientMessage to SendMessage, i think no problem but....
Re: Command define -
[XST]O_x - 19.09.2010
You can use a very simple definition:
pawn Код:
#define SendMessage SendClientMessage
Means the compiler will replace every SendMessage with SendClientMessage on the compilation and vice versa.
Or simply:
pawn Код:
stock SendMessage(playerid,color,message[])
{
return SendClientMessage(playerid,color,message);
}
Re: Command define -
Typhome - 19.09.2010
Quote:
Originally Posted by [XST]O_x
You can use a very simple definition:
pawn Код:
#define SendMessage SendClientMessage
Means the compiler will replace every SendMessage with SendClientMessage on the compilation and vice versa.
Or simply:
pawn Код:
stock SendMessage(playerid,color,message[]) { return SendClientMessage(playerid,color,message); }
|
Thanks!
What about..? ProxDetector?
stock Prox(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
}
then?
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
Re: Command define -
[XST]O_x - 19.09.2010
You firstly need to have the stock of ProxDetector, after you have it, you can again,simply,do:
pawn Код:
#define Prox ProxDetector
Or:
pawn Код:
stock Prox(Float:radi,playerid,string[],col1,col2,col3,col4,col5)
{
return ProxDetector(Float:radi, playerid, string,col1,col2,col3,col4,col5);
}