PI
The world on the edge of reality
Ко всем new добавим
в Public OnPlayerConnect
далее в Public OnPlayerConnect добавить
в Public OnPlayerDisconnect
Ко всем командам добавить
Спасибо за внимание!
PHP:
new toglogin[MAX_PLAYERS];
PHP:
toglogin[playerid] = 0;
PHP:
new str[256], condisname[MAX_PLAYER_NAME];
GetPlayerName(playerid, condisname, sizeof(condisname));
if(toglogin[playerid] == 1)
{
format(str, sizeof(str), "%s[%d] присоеденился к серверу!", condisname,playerid);
SendClientMessage(playerid,COLOR_YELLOW2, str);
}
PHP:
new str[256], condisname[MAX_PLAYER_NAME];
GetPlayerName(playerid, condisname, sizeof(condisname));
if(toglogin[playerid] == 1)
{
switch (reason)
{
case 0: format(str, sizeof(str), " %s вылетел(а) из игры", condisname);
case 1: format(str, sizeof(str), " %s вышeл из игры", condisname);
case 2: format(str, sizeof(str), " %s кикнут(а) или забанен(а)", condisname);
}
SendClientMessage(playerid,COLOR_GREY, str);
}
PHP:
if(strcmp(cmd, "/toglogins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (!toglogin[playerid])
{
toglogin[playerid] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Входы/Выходы выключены!");
}
else if (toglogin[playerid])
{
toglogin[playerid] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Входы/Выходы включены!");
}
}
return 1;
}
