22.12.2018, 18:43
What's the difference between SCM and SCMEx for people to make a function?
Can you figure out what a function named `KickEx` would do? I sure can't... Does it kick the player with a reason message? Does it kick the player after a timer? Does it kick the player and order me a pizza via a HTTP call to the Dominos web API?
|
Kick() was fixed back in SA-MP 0.3x RC3 when it didn't always send kick messages. I think it was given higher packet priority or something, so KickEx() was introduced by people to work around that and send custom messages, fire a timer of like 500ms and then kick them, thus allowing time for the server to send a message back to the client before they got kicked. At least, that's the original reason it was adopted. Other variations were KickWithMessage(), which while more verbose than KickEx, it offers more clarity in its purpose.
Edit// just realised you're talking about the actual name of the function rather than its purpose, see last sentence for a more appropriate answer |
#define MAX_CLIENT_MSG_LENGTH 144 SendClientMessage2(playerid, color, message[]) { if (strlen(message) <= MAX_CLIENT_MSG_LENGTH) return SendClientMessage(playerid, color, message); new string[MAX_CLIENT_MSG_LENGTH + 1]; strmid(string, message, 0, MAX_CLIENT_MSG_LENGTH); return SendClientMessage(playerid, color, string); } SendClientMessageToAll2(color, message[]) { if (strlen(message) <= MAX_CLIENT_MSG_LENGTH) return SendClientMessageToAll(color, message); new string[MAX_CLIENT_MSG_LENGTH + 1]; strmid(string, message, 0, MAX_CLIENT_MSG_LENGTH); return SendClientMessageToAll(color, string); }