OOC Chat, help.
#1

Okay, so I tried to edit my script so that when an administrator with a certain admin level said something in OOC chat, It came up with his rank. I attempted and it resulted in this.


This is my code in the script.
Код:
command(o, playerid, params[])
{
	new Message[128], string[128];
	if(sscanf(params, "z", Message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /o(oc) [message]");
	}
	else
	{
	    if(Player[playerid][oMuted] >= 1)
	    {
	        SendClientMessage(playerid, WHITE, "You have been muted from the global OOC channel by an administrator.");
	    }
	    else
	    {
			if(Player[playerid][AdminLevel] >= 2)
			{
			    format(string, sizeof(string), "((Administrator %s: %s)) ", GetName(playerid), Message);
			    SendClientMessageToAll(OOC_CHAT, string);
			}
			if(Player[playerid][AdminLevel] >= 5)
			{
			    format(string, sizeof(string), "((Head Administrator %s: %s)) ", GetName(playerid), Message);
			    SendClientMessageToAll(OOC_CHAT, string);
			}
			if(Player[playerid][AdminLevel] >= 1)
			{
			    format(string, sizeof(string), "((Moderator %s: %s)) ", GetName(playerid), Message);
			    SendClientMessageToAll(OOC_CHAT, string);
			}
			if(Player[playerid][AdminLevel] >= 1338)
			{
			    format(string, sizeof(string), "((Server Owner %s: %s)) ", GetName(playerid), Message);
			    SendClientMessageToAll(OOC_CHAT, string);
			}
			else if(oocenabled == 1 && Player[playerid][Authenticated] >= 1)
			{
			    if(Player[playerid][VipRank] >= 1)
			    {
			        format(string, sizeof(string), "((VIP %s: %s)) ", GetName(playerid), Message);
			    	for(new i = 0; i < MAX_PLAYERS; i++)
					{

						if(IsPlayerConnectedEx(i) && Player[i][ToggedOOC] == 0)
						{
					   		SendClientMessage(i, OOC_CHAT, string);
						}
					}

					OOCChatLog(string);
			    }
			    else
			    {
				    if(Player[playerid][PlayingHours] < 1)
				    {
						format(string, sizeof(string), "((%s %s: %s))", OOCRanks[Rank1], GetName(playerid), Message);
			    		for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnectedEx(i) && Player[i][ToggedOOC] == 0)
					        {
					            SendClientMessage(i, OOC_CHAT, string);
					        }
					    }
					}
				    else if(Player[playerid][PlayingHours] >= 1 && Player[playerid][PlayingHours] < 25)
				    {
						format(string, sizeof(string), "((%s %s: %s))", OOCRanks[Rank2], GetName(playerid), Message);
			    		for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnectedEx(i) && Player[i][ToggedOOC] == 0)
					        {
					            SendClientMessage(i, OOC_CHAT, string);
					        }
					    }
					}
				    else if(Player[playerid][PlayingHours] >= 25 && Player[playerid][PlayingHours] < 100)
				    {
						format(string, sizeof(string), "((%s %s: %s))", OOCRanks[Rank3], GetName(playerid), Message);
			    		for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnectedEx(i) && Player[i][ToggedOOC] == 0)
					        {
					            SendClientMessage(i, OOC_CHAT, string);
					        }
					    }
					}
				    else if(Player[playerid][PlayingHours] >= 100 && Player[playerid][PlayingHours] < 300)
				    {
						format(string, sizeof(string), "((%s %s: %s))", OOCRanks[Rank4], GetName(playerid), Message);
			    		for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnectedEx(i) && Player[i][ToggedOOC] == 0)
					        {
					            SendClientMessage(i, OOC_CHAT, string);
					        }
					    }
				    }
				    else if(Player[playerid][PlayingHours] >= 300)
				    {
						format(string, sizeof(string), "((%s %s: %s))", OOCRanks[Rank5], GetName(playerid), Message);
					    for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnectedEx(i) && Player[i][ToggedOOC] == 0)
					        {
					            SendClientMessage(i, OOC_CHAT, string);
					        }
					    }
					}

				    OOCChatLog(string);
			    }
			}
			else if(oocenabled == 0)
			{
			    SendClientMessage(playerid, WHITE, "OOC channel is currently disabled.");
			}
		}
	}
	return 1;
}
I tried to define the admin rank to the name, but it just came up with undefined, If someone could help that'd be amazing.
Reply
#2

hmm can u please explain or u wanna tell that u want the rankname and the rank too or only rank ?
Reply
#3

If you look at the code, I want that rank too that admin level, but if you look at the screenshot, They all seem to take effect if your all the admin levels.
Reply
#4

Quote:
Originally Posted by Joshswag
Посмотреть сообщение
If you look at the code, I want that rank too that admin level, but if you look at the screenshot, They all seem to take effect if your all the admin levels.
O.o i didnt understand ... the highest admin level will always have controll on other powers ... of smallers levels u mean to say like this

pawn Код:
((Server Owner [Level: 1338] Dark : test))
Reply
#5

z nope iz s[32] in sscanf not z and use params
Reply
#6

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
z nope iz s[32] in sscanf not z
well s[32] will help cuz "s" also helps lol...
Reply
#7

Can you rewrite the script for me?
Reply
#8

sure
Reply
#9

u copied this for sure, alot of tags are missing imma fix up the entire code 4 u
Reply
#10

Change >= to ==
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)