SA-MP Forums Archive
Command working only for players with specific colour. - 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: Command working only for players with specific colour. (/showthread.php?tid=536895)



Command working only for players with specific colour. - cs_waller - 12.09.2014

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!


Re: Command working only for players with specific colour. - ZombieNest - 12.09.2014

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



Re: Command working only for players with specific colour. - cs_waller - 12.09.2014

Works exactly like i wanted to, cheers!