25.08.2016, 23:40
Instead of repeating myself when kicking a player, I've added a few parameters to my kick function and I'm now sending the message in the function's body.
I am using a custom function to send tagged messages (i.e: "[Error] message", where [Error] is the tag) but it's basically the same as 'ChatMsg' as seen in Southclaw's Scavenge&Survive: https://github.com/Southclaw/Scaveng...ls/message.pwn
Now all this has been irrelevant to the actual problem, which is the following line:
I've managed to dismantle the code to find the culprit and I was able to break it down to:
Specifically to:
Replacing it with a literal string, fixes the problem, but is not the solution I seek:
Is my code invalid or is this a compiler bug(/restriction?)?
By the way, epd_Username is declared as:
And I'm using it in OnPlayerConnect:
PHP код:
KickEx(playerid, const reason[], kickerid = INVALID_PLAYER_ID)
Now all this has been irrelevant to the actual problem, which is the following line:
PHP код:
SendTaggedMessageToPlayer(playerid, TYPE_ADMIN, "%p has been kicked by the server by %s, reason: %s", playerid, ((kickerid == INVALID_PLAYER_ID) ? ("The Server") : (Player[kickerid][epd_Username])), reason);
PHP код:
((kickerid == INVALID_PLAYER_ID) ? ("The Server") : (Player[kickerid][epd_Username]))
PHP код:
Player[kickerid][epd_Username]
PHP код:
((kickerid == INVALID_PLAYER_ID) ? ("The Server") : (""))
By the way, epd_Username is declared as:
PHP код:
epd_Username[MAX_PLAYER_NAME]
PHP код:
GetPlayerName(playerid, Player[playerid][epd_Username], MAX_PLAYER_NAME);