28.07.2012, 21:28
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.");
}