How can I disable the chat for registered players that aren't logged in?
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][Registered] == 1 &&  PlayerInfo[playerid][LoggedIn] == 1)
    {
        //Your code for the chat here, if any
        return 1;
    }
    else return SendClientMessage(playerid, 0xFFFF00, "ERROR: You are currently not logged in.");
}
   
   
   
//And to only send messages to players that are logged in you do this


public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][Registered] == 1 &&  PlayerInfo[playerid][LoggedIn] == 1)
    {
        new string[156];
        new name[24];
        GetPlayerName(playerid, name, 24);
        format(string, sizeof(string), "%s Says: %s", name, text);
        foreach(Player, i)
        {
            if(PlayerInfo[i][Registered] == 1 &&  PlayerInfo[i][LoggedIn] == 1) SendClientMessage(i, 0xFFFF00, string);
        }
    }
    else return SendClientMessage(playerid, 0xFFFF00, "ERROR: You are currently not logged in.");
}
Untested but should work fine
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)