Why do people make SendClientMessageEx? -
Stefhan - 22.12.2018
What's the difference between SCM and SCMEx for people to make a function?
Re: Why do people make SendClientMessageEx? -
Stefhan - 22.12.2018
Thanks a lot for the clarification, so this goes for anything with Ex? Such as KickEx
Re: Why do people make SendClientMessageEx? -
Infin1ty - 22.12.2018
amen
Re: Why do people make SendClientMessageEx? -
TheToretto - 22.12.2018
Quote:
Originally Posted by Infin1ty
amen
|
lmaooo
Re: Why do people make SendClientMessageEx? -
cuber - 22.12.2018
amen brother
Re: Why do people make SendClientMessageEx? -
sammp - 24.12.2018
Quote:
Originally Posted by [HLF]Southclaw
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
Re: Why do people make SendClientMessageEx? -
beckzy - 24.12.2018
Quote:
Originally Posted by sammp
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 
|
Are you sure messages not being sent before Kick() was fixed? They still aren't sent for me.
Back on topic - my SendClientMessageEx/SendClientMessageToAllEx functions are named SendClientMessage2/SendClientMessageToAll2:
Код:
#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);
}
If a client message longer than 144 is sent, the message won't be visible. So I use SendClientMessage2/SendClientMessageToAll2 to crop the message if it's longer than 144.
Re: Why do people make SendClientMessageEx? -
Jay_ - 24.12.2018
Quote:
Originally Posted by BeckzyBoi
Back on topic - my SendClientMessageEx/SendClientMessageToAllEx functions are named SendClientMessage2/SendClientMessageToAll2:
|
I think you've missed the point...
Re: Why do people make SendClientMessageEx? -
beckzy - 24.12.2018
Quote:
Originally Posted by Jay_
I think you've missed the point...
|
I was showing an example of why some people would use their own alternative SendClientMessage function?
Re: Why do people make SendClientMessageEx? -
GhostHacker9 - 24.12.2018
I name my function SendClientMessageDecember2018