SA-MP Forums Archive
Scripting Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Scripting Help (/showthread.php?tid=442445)



Scripting Help - Akira297 - 07.06.2013

-
It's been awhile since I've made a thread in here, but I need some assistance. It isn't the fact I get errors it's just simply, it doesn't appear in-game.


That's is the administration login text.

Код:
		if (PlayerInfo[playerid][pAdmin] > 0)
		{
			if(PlayerInfo[playerid][pAdmin] == 1)
			{
				SendClientMessageEx(playerid, COLOR_WHITE,"SERVER: You are logged in as a Moderator.");
			}
			else
			{
				format(string2, sizeof(string2), "SERVER: You are logged in as a Level %d Admin.",PlayerInfo[playerid][pAdmin],ARankC(playerid));
				SendClientMessageEx(playerid, COLOR_WHITE,string2);
			}

			if(PlayerInfo[playerid][pAdmin] == 1)
			{
				format( string2, sizeof( string2 ), "SERVER: %s has logged in as a Moderator.", GetPlayerNameEx( playerid ));
			}
			else
			{
				format( string2, sizeof( string2 ), "SERVER: %s has logged in as a Level %d Admin.",GetPlayerNameEx( playerid ),PlayerInfo[playerid][pAdmin],ARankC(playerid));
			}

			foreach(Player, i)
			{
				if( PlayerInfo[i][pAdmin] >= 1337 )
				{
					if(PlayerInfo[i][pAdmin] >= PlayerInfo[playerid][pAdmin]) SendClientMessageEx(i, COLOR_WHITE, string2);
				}
			}

		}
This is ARankC

Код:
stock ARankC(playerid)
{
	new rank[32];
	if(PlayerInfo[playerid][pHelper] == 2) format(rank, sizeof(rank), "Community Advisor");
	else if(PlayerInfo[playerid][pHelper] == 3) format(rank, sizeof(rank), "Senior Advisor");
	else if(PlayerInfo[playerid][pHelper] == 4) format(rank, sizeof(rank), "Chief Advisor");
	else if(PlayerInfo[playerid][pAdmin] == 1) format(rank, sizeof(rank), "{C85A17}[Server Moderator]");
	else if(PlayerInfo[playerid][pAdmin] == 2) format(rank, sizeof(rank), "{808000}[Junior Admin]");
	else if(PlayerInfo[playerid][pAdmin] == 3) format(rank, sizeof(rank), "{008080}[General Admin]");
	else if(PlayerInfo[playerid][pAdmin] == 4) format(rank, sizeof(rank), "{FFFF00}[Senior Admin]");
	else if(PlayerInfo[playerid][pAdmin] == 1337) format(rank, sizeof(rank), "{FF030D}[Head Admin]");
	else if(PlayerInfo[playerid][pAdmin] == 1338) format(rank, sizeof(rank), "{FF0000}[Admin Director]");
	else if(PlayerInfo[playerid][pAdmin] == 99998) format(rank, sizeof(rank), "{00FFFF}[Community Manager]");
	else if(PlayerInfo[playerid][pAdmin] == 99999) format(rank, sizeof(rank), "{00FF00}[Community Owner]");
	else format(rank, sizeof(rank), "{FFFFFF}Undefined Admin (%d)", PlayerInfo[playerid][pAdmin]);
	return rank;
}
I'm trying to make it whenever you join the server instead of identifying it but amount of numbers, it simply says the administration name. I don't want to make multiply

Код:
	if (PlayerInfo[playerid][pAdmin] > 0)
		{
			if(PlayerInfo[playerid][pAdmin] == 1)
			{
				SendClientMessageEx(playerid, COLOR_WHITE,"SERVER: You are logged in as a Moderator.");
			}
			else
			{
				format(string2, sizeof(string2), "SERVER: You are logged in as a Level %d Admin.",PlayerInfo[playerid][pAdmin],ARankC(playerid));
				SendClientMessageEx(playerid, COLOR_WHITE,string2);
			}
-

So anyway of making this alot more shorter?


Re: Scripting Help - Kyle - 07.06.2013

Posting on my profile asking for help won't get help...


Re: Scripting Help - Akira297 - 07.06.2013

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
Posting on my profile asking for help won't get help...
I was recommended to ask you, lol.


Re: Scripting Help - Pottus - 07.06.2013

pawn Код:
if (PlayerInfo[playerid][pAdmin] > 0)
{
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
        SendClientMessageEx(playerid, COLOR_WHITE,"SERVER: You are logged in as a Moderator.");
        format( string2, sizeof( string2 ), "SERVER: %s[%s] has logged in as a Moderator.", GetPlayerNameEx( playerid ), ARankC(playerid));
    }
    else

    {
        format(string2, sizeof(string2), "SERVER: You are logged in as a Level %d[%s] Admin.",PlayerInfo[playerid][pAdmin],ARankC(playerid));
        SendClientMessageEx(playerid, COLOR_WHITE,string2);
        format( string2, sizeof( string2 ), "SERVER: %s[%s] has logged in.",GetPlayerNameEx( playerid ),PlayerInfo[playerid][pAdmin],ARankC(playerid));
    }

    foreach(Player, i)
    {
        if( PlayerInfo[i][pAdmin] >= 1337 )
        {
            if(PlayerInfo[i][pAdmin] >= PlayerInfo[playerid][pAdmin]) SendClientMessageEx(i, COLOR_WHITE, string2);
        }
    }
}