SendClientMessageToAll
#1

Hi. I would like to add if a Admin or VIP join the server. It will be like this:

"Admin Level 5 - Cocomber (ID:2) has been joined the server" <<-- For admin
"VIP Level 3 - Bibingka (ID:5) has been joined the server" << -- For VIP


this is my onplayerconnect

Код:
public OnPlayerConnect(playerid)
{
	SetPVarInt(playerid, "GotoEnabled", 1); //Go Check
    SetPVarInt(playerid, "PMEnabled",1);
    SetPVarInt(playerid, "GodMode", 0); //God mode Check

    ClearWeapons(playerid); //godmode

	SendDeathMessage(INVALID_PLAYER_ID,playerid, 200);
	SetTimerEx("VRepair",500,true,"i",playerid);

    if(IsPlayerNPC(playerid)) return 1;
    #if SpecTextDraw == true
    CreateSpecTD(playerid);
    #endif
    new Jfile[100],pIP[16],Jstr[128];
    strdel(aka,0,256);
    GetPlayerIp(playerid,pIP,16);
    GetPlayerIp(playerid,playerIP,16);
    format(Jfile,sizeof(Jfile),"JLadmin/Logs/aka.ini");
    INI_ParseFile(Jfile,"GetAkaLog");
    ResetVariables(playerid);
    if(strlen(aka) < 3)
    {
            format(Jfile,sizeof(Jfile),"JLadmin/Logs/aka.ini");
            new INI:AKA = INI_Open(Jfile);
            INI_WriteString(AKA, pIP, GetName(playerid));
            INI_Close(AKA);
    }
    else if(strfind(aka, GetName(playerid), true) == -1)
        {
        	format(Jfile,sizeof(Jfile),"JLadmin/Logs/aka.ini");
        	format(Jstr,sizeof(Jstr),"%s,%s", aka, GetName(playerid));
         	new INI:AKA = INI_Open(Jfile);
         	INI_WriteString(AKA, pIP, Jstr);
         	INI_Close(AKA);
        }
    if(strlen(aka) > 70)
        {
        strmid(Jstring,aka,0,70);
        format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: %s", GetName(playerid),playerIP , Jstring);
        SendToAdmins(Cmdcolor,Jstr);
        strmid(Jstring,aka,70,sizeof(aka));
        format(Jstr, sizeof(Jstr),"%s", Jstring);
        SendToAdmins(Cmdcolor,Jstr);
        }
        else
        {
        if(strlen(aka) > 2) format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: %s", GetName(playerid),playerIP , aka);
        else format(Jstr, sizeof(Jstr),"Sign in >> Player: %s - IP: %s - AKA: No aka found!", GetName(playerid),playerIP);
        SendToAdmins(Cmdcolor,Jstr);
    }
    format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
    if(!fexist(Jfile))
    {
        format(Jstring, sizeof(Jstring),"Nickname \"%s\" isn't registered. Please register your nick name to save your status\nEnter the password:", GetName(playerid));
        if(MustRegister == 1) ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register an account!", Jstring, "Register", "Kick");
        SendClientMessage(playerid,red,">> You are not yet registered. Please register to save your status");
        SendClientMessage(playerid, white,">> Please register to create an account {ffd700}/register");
    }
    else
        {
        pInfo[playerid][Registered] = 1;
        format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
        INI_ParseFile(Jfile, "GetPlayerInfo", .bExtra = true, .extra = playerid);
        if(AutoLogin == 1 && (!strcmp(pIP, pInfo[playerid][IP],true) && pInfo[playerid][pAutoLogin] == 1))
        {
            format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
            INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid);
            SetPlayerScore(playerid, pInfo[playerid][Score]);
            GivePlayerMoney(playerid, pInfo[playerid][Cash]);
            pInfo[playerid][Logged] = 1;
            if(pInfo[playerid][pLevel] >= 1)
            			{
            			switch(pInfo[playerid][pLevel])
                            {
                              case 1: LevelName = ADMIN_LEVEL_1;
                              case 2: LevelName = ADMIN_LEVEL_2;
                              case 3: LevelName = ADMIN_LEVEL_4;
                              case 4: LevelName = ADMIN_LEVEL_3;
                              case 5: LevelName = ADMIN_LEVEL_5;
                              default: LevelName = ADMIN_LEVEL_6;
                			}
            			format(Jstring, sizeof(Jstring),">> Welcome back, You have been automatically logged in! | Level: %d (%s)", pInfo[playerid][pLevel], LevelName);
            			SendClientMessage(playerid,lighterblue,Jstring);
                  	 	}
                        else
                        SendClientMessage(playerid,lighterblue,">> Welcome back, You have been automatically logged in");
        }
                else
                {
                        #if LoginTextDraw == false
                format(Jstring, sizeof(Jstring),"Nickname \"%s\" registered.\nPlease enter your password to login", GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Account Login", Jstring, "Login", "Quit");
                #endif
                SendClientMessage(playerid,lighterblue,">> This name is registered to the server");
                SendClientMessage(playerid,red,">> Please /login access your account");
        }
    }
    if(ForbiddenNamesKick == 1 && IsForbiddenNick(playerid) == 1)
    {
        format(Jstring, sizeof(Jstring),"{FB0404}Your nickname \"%s\" is in blacklist. Please relog\nwith a new nickname", GetName(playerid));
        ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX,"     {FB0404}Forbidden nick", Jstring, "Close", "");
        SetTimerEx("KickPlayer",200,false,"d", playerid);
        format(Jstring, sizeof(Jstring),">> \"%s\" has been automatically kicked | Reason: Forbidden Name", GetName(playerid));
        SendToAdmins(orange,Jstring);
        WriteToLog(Jstring,"KickLog");
    }
    if(KickPartNicks == 1 && IsBadNickPart(playerid) == 1)
    {
        format(Jstring, sizeof(Jstring),">> {FB0404}Your nick name part \"%s\" is in Forbidden part nick names list.\nplease relog with a new nick name", BadNickParts[BadPartID]);
        ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX,"     {FB0404}Forbidden part nick", Jstring, "Close", "");
        SetTimerEx("KickPlayer",200,false,"d", playerid);
        format(Jstring, sizeof(Jstring),">> \"%s\" has been automatically kicked | reason: 'Forbidden part nick (%s)'", GetName(playerid),BadNickParts[BadPartID]);
        SendToAdmins(orange,Jstring);
        WriteToLog(Jstring,"KickLog");
    }
    return 1;
}
Reply
#2

It's on your previous thread.

http://forum.sa-mp.com/showpost.php?...70&postcount=7
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Thanks for helping my again dude. but sorry coz im using different filterscript now. Can you please help me with this new one? thanks looking forward.
Reply
#4

Hi anyone? looking for any help. ty very much!
Reply
#5

Dont bump withing 24 hours atleast, you may get a infraction.

Код:
enum PlayerData
{
	Level,
};

new PlayerInfo[MAX_PLAYERS][PlayerData];


if(PlayerInfo[playerid][Level] >= 1) {

GetPlayerName(playerid, name, sizeof(name));
	format(string1, sizeof(string1), "Level %d Administrator%s has joined the server.", PlayerInfo[playerid][Level] , name);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
try this
Reply
#6

Quote:
Originally Posted by Superhot
Посмотреть сообщение
Dont bump withing 24 hours atleast, you may get a infraction.

Код:
enum PlayerData
{
	Level,
};

new PlayerInfo[MAX_PLAYERS][PlayerData];


if(PlayerInfo[playerid][Level] >= 1) {

GetPlayerName(playerid, name, sizeof(name));
	format(string1, sizeof(string1), "Level %d Administrator%s has joined the server.", PlayerInfo[playerid][Level] , name);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
try this
Thanks for your kindly response. Actually im using my own enum.

Код:
          			format(Jstring, sizeof(Jstring), "Admin Level %d - %s (ID: %s )has joined the server.",pInfo[playerid][pLevel], GetName(playerid), playerid);
    					SendClientMessageToAll(red,Jstring);
So when I do reconnect to the server then join and no text I set my admin already.

Also check some of the script under onplayerconnect..

Код:
    if(!fexist(Jfile))
    {
        format(Jstring, sizeof(Jstring),"Nickname \"%s\" isn't registered. Please register your nick name to save your status\nEnter the password:", GetName(playerid));
        if(MustRegister == 1) ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register an account!", Jstring, "Register", "Kick");
        SendClientMessage(playerid,red,">> You are not yet registered. Please register to save your status");
        SendClientMessage(playerid, white,">> Please register to create an account {ffd700}/register");
    }
    else
        {
        pInfo[playerid][Registered] = 1;
        format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
        INI_ParseFile(Jfile, "GetPlayerInfo", .bExtra = true, .extra = playerid);
        if(AutoLogin == 1 && (!strcmp(pIP, pInfo[playerid][IP],true) && pInfo[playerid][pAutoLogin] == 1))
        {
            format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
            INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid);
            SetPlayerScore(playerid, pInfo[playerid][Score]);
            GivePlayerMoney(playerid, pInfo[playerid][Cash]);
            pInfo[playerid][Logged] = 1;
            if(pInfo[playerid][pLevel] >= 1)
            			{
            			switch(pInfo[playerid][pLevel])
                            {
                              case 1: LevelName = ADMIN_LEVEL_1;
                              case 2: LevelName = ADMIN_LEVEL_2;
                              case 3: LevelName = ADMIN_LEVEL_4;
                              case 4: LevelName = ADMIN_LEVEL_3;
                              case 5: LevelName = ADMIN_LEVEL_5;
                              default: LevelName = ADMIN_LEVEL_6;
                			}
            			format(Jstring, sizeof(Jstring),">> Welcome back, You have been automatically logged in! | Level: %d (%s)", pInfo[playerid][pLevel], LevelName);
            			SendClientMessage(playerid,lighterblue,Jstring);
            			format(Jstring, sizeof(Jstring), "Admin Level %d - %s (ID: )has joined the server.",pInfo[playerid][pLevel], GetName(playerid), playerid);
    					SendClientMessageToAll(red,Jstring);
                  	 	}
                        else
                        SendClientMessage(playerid,lighterblue,">> Welcome back, You have been automatically logged in");
        }
                else
                {
                        #if LoginTextDraw == false
                format(Jstring, sizeof(Jstring),"{ffd700}Welcome to All Out Gaming Server {09F7DF}\n\nAccount Name: {FFFFFF}%s \n\nPlease enter your password to login", GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{09F7DF}AoG Server - Account Login", Jstring, "Login", "Quit");
                #endif
                SendClientMessage(playerid,lighterblue,">> This name is registered to the server");
                SendClientMessage(playerid,red,">> Please {ffd700}/login {FF0000}to access your account");
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)