Colored Player in Map / Chat
#1

Hello,
well i know my english is not the best bat i think you can understand what i want:
Can you tell / link me a Filterscript to show all Players on the Server Colored (Any Fraction has his own color) on the Map and in the Chat?
I have seen this on other Server bat i did'nt find a script.

And my 2. Question what is Wrong:
Код:
	if (!strcmp("/checkadmin", cmdtext))
	{
		  if(IsPlayerAdmin(playerid)) == 1)
				{
				SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
				}
			else SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
  return 1;
	}
I want to Check if the Player is an Admin or not.


Thanks for reading,
Greetz, Teyhouse
Reply
#2

what this doesnt work?
pawn Код:
if (!strcmp("/checkadmin", cmdtext))
    {
          if(IsPlayerAdmin(playerid)) == 1)
                {
                SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
                }
            else SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
  return 1;}
anyway it should look like this
pawn Код:
if (!strcmp("/checkadmin", cmdtext))
    {
          if(IsPlayerAdmin(playerid)) == 1)
                {
                SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
                }
 if(IsPlayerAdmin(playerid)) == 0)
            {SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
              }
  return 1;}
Reply
#3

Quote:
Originally Posted by BiG_Sm0k3
what this doesnt work?
pawn Код:
if (!strcmp("/checkadmin", cmdtext))
    {
          if(IsPlayerAdmin(playerid)) == 1)
                {
                SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
                }
            else SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
  return 1;}
anyway it should look like this
pawn Код:
if (!strcmp("/checkadmin", cmdtext))
    {
          if(IsPlayerAdmin(playerid)) == 1)
                {
                SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
                }
 if(IsPlayerAdmin(playerid)) == 0)
            {SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
              }
  return 1;}
Actually his example would work fine.. If you wanted to make it shorter you can do:

pawn Код:
if (!strcmp("/checkadmin", cmdtext))
{
    if(IsPlayerAdmin(playerid)) == 1)
      SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
    else
      SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
  return 1;
}
But to change colors, Replace COLOR_YELLOW with a Hex+Alpha code. For Example, #FF0000FF is red.
Reply
#4

Yes great thankyou, bat what about my first Problem?
I want to see Player in his own each color? For Example:
A Hitman comes Online, i saw he at the Minimap because his Color ist Brown.
You see all Player from Hitman are on the map brown, in the "TAB" -List
and in the Global-Chat!?
Have you an Addon for this?
If you can't understand you would look at this:
Reply
#5

SetPlayerColor(playerid,0xFF0000FF); <-- That will set a players color Red. Players color is affected in Minimap and Global Chat.
Reply
#6

Thanks, bat i saw that doesn't work:
Код:
if (!strcmp("/checkadmin", cmdtext))
{
    if(IsPlayerAdmin(playerid)) == 1)
      SendClientMessage (playerid, COLOR_YELLOW, "-You are a Admin!!-");
    else 
      SendClientMessage(playerid, COLOR_YELLOW, "You are Nothing!!");
  return 1;
}
I got 4 Errors:
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#7

pawn Код:
if(strcmp(cmdtext, "/checkadmin", true) == 0)
{
  if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, "You are a Admin!!");
  else return SendClientMessage(playerid, COLOR_YELLOW, "You are nothing!!");
}
Reply
#8

I logged in as Admin Level 1337 bat it doesn't work!?
The Output Ingame is "You are Nothing" also the else-case - what is wrong?
It got you Code 1 to 1 into my... mhhh crazy....
Reply
#9

That cmd checks if you're an rcon admin.
Reply
#10

Quote:
Originally Posted by Teyhouse
I logged in as Admin Level 1337 bat it doesn't work!?
The Output Ingame is "You are Nothing" also the else-case - what is wrong?
It got you Code 1 to 1 into my... mhhh crazy....
These codes are using IsPlayerAdmin which is the rcon admin. What admin system are you using?

EDIT:
Dice bet me =/
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)