2021-02-19, 02:49 PM
How can I make sure that only the players who are in my virtual world can read the message that I send, and that those who are not in my virtual world do not read the message?
Code:
CMD:gl(playerid, params[])
{
? ? new Text[132], string[128], PlayerName[MAX_PLAYER_NAME];
? ? if(sscanf(params, "s[132]", Text))
? ? {
? ? ? ? SendClientMessage(playerid, -1, "{D41818}[COMANDO]{AFAFAF} /gl <texto>");
? ? }
? ? else
? ? {
? ? ? ? GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); // storing player name first in the PlayerName variable
? ? ? ? format(string, sizeof(string), "[ID:%d - %s]: %s",playerid, PlayerName, Text); //[ID:12 - Sebasti?n Price] texto
? ? ? ? SendClientMessageToAll(0xFFFFFF00, string);
? ? }
? ? return 1;
}