SA-MP Forums Archive
Colored Player in Map / Chat - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Colored Player in Map / Chat (/showthread.php?tid=81655)



Colored Player in Map / Chat - Teyhouse - 13.06.2009

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


Re: Colored Player in Map / Chat - HuRRiCaNe - 13.06.2009

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;}



Re: Colored Player in Map / Chat - Pghpunkid - 13.06.2009

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.


Re: Colored Player in Map / Chat - Teyhouse - 13.06.2009

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:



Re: Colored Player in Map / Chat - Pghpunkid - 14.06.2009

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


Re: Colored Player in Map / Chat - Teyhouse - 14.06.2009

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


Re: Colored Player in Map / Chat - Grim_ - 14.06.2009

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!!");
}



Re: Colored Player in Map / Chat - Teyhouse - 14.06.2009

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....



Re: Colored Player in Map / Chat - dice7 - 14.06.2009

That cmd checks if you're an rcon admin.


Re: Colored Player in Map / Chat - Gappy - 14.06.2009

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 =/