18.03.2019, 12:07
MessageKick(playerid, message[], (mixed));
Based on SendClientMessageEx function:
https://forum.sa-mp.com/showpost.php...postcount=4529
Usage:
Code:
You can change the amount ms to 500 or 10000000 if Kick with 200ms still won't show a message.
----
GenerateVoucher(output[])
This function can create a voucher like:
VOC-2FE3-JB2E-EK56-AB2T-R32F
Usage:
Code:
Based on SendClientMessageEx function:
https://forum.sa-mp.com/showpost.php...postcount=4529
Usage:
PHP Code:
public OnPlayerConnect(playerid)
{
MessageKick(playerid, "You're not worth to join %s server", SERVER_NAME);
return 1;
}
PHP Code:
stock MessageKick(playerid, const message[], {Float, _}:...)
{
static
args,
str[144];
/*
* Custom function that uses #emit to format variables into a string.
* This code is very fragile; touching any code here will cause crashing!
*/
if ((args = numargs()) == 2)
{
SendClientMessage(playerid, 0xFFFFFFAA, message);
SetTimerEx("Kick", 200, false, "i", playerid);
}
else
{
while (--args >= 2)
{
#emit LCTRL 5
#emit LOAD.alt args
#emit SHL.C.alt 2
#emit ADD.C 12
#emit ADD
#emit LOAD.I
#emit PUSH.pri
}
#emit PUSH.S message
#emit PUSH.C 144
#emit PUSH.C str
#emit LOAD.S.pri 8
#emit ADD.C 4
#emit PUSH.pri
#emit SYSREQ.C format
#emit LCTRL 5
#emit SCTRL 4
SendClientMessage(playerid, 0xFFFFFFAA, str);
SetTimerEx("Kick", 200, false, "i", playerid);
#emit RETN
}
return 1;
}
----
GenerateVoucher(output[])
This function can create a voucher like:
VOC-2FE3-JB2E-EK56-AB2T-R32F
Usage:
PHP Code:
CMD:createvoucher(playerid, params[])
{
new str[64];
GenerateVoucher(str);
format(str, sizeof(str), "Successfully created a voucher (%s)", str);
SendClientMessage(playerid, str);
return 1;
}
PHP Code:
stock GenerateVoucher(output[])
{
new emee[25], total;
for(new sa = 0; sa < sizeof(emee); sa++)
{
total = sa % 5;
emee[sa] = random(2) ? (random(26) + 'A') : (random(10) + '0');
if(total == 0 && emee[sa] != EOS) {
emee[sa] = '-';
}
}
format(output, sizeof(emee)+4, "VOC%s", emee);
return 1;
}