Command working only for players with specific colour.
#1

Hello, i'm stuck on one command which i want to make for my server, i want to make a command which is working only for players with specific colours (0xACFF59FF).
Something like

pawn Код:
if(strcmp(cmd, "/hpall", true) == 0)
    {
      SetPlayerHealth(playerid, 100);
        return 1;
        }
    }
But working for players with the colour 0xACFF59FF. Is that possible, if yes please help me!
Reply
#2

Yes it is possible
Try the function GetPlayerColor()

Try this, I havent test it yet

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/hpall", true) == 0)
    {
        if(GetPlayerColor(playerid) >>> 0xACFF59FF)
        {
      	SetPlayerHealth(playerid, 100);
        return 1;
        }
    }
	return 0;
}
Reply
#3

Works exactly like i wanted to, cheers!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)