help please - 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: help please (
/showthread.php?tid=127458)
help please -
bartje01 - 13.02.2010
Hey guys. I am looking for a cmd that does this:
/cr (copradio)
Like /cr [text]
But I only want that this player color can use it: 0x2641FEAA
And that color can see the text only too.
Is this possible? If yes: Please help me
Re: help please -
Miguel - 13.02.2010
I don't know what commands are you using but I'll give you an example with dcmd:
pawn Код:
dcmd_cr(playerid, params[])
{
if(strlen(params) < 1) return SendClientMessage(playerid, COLOR, "Syntax: /cr <text>");
else
{
new
pName[24],
string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Officer %s: %s", pName, params);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(Level[i] == COPS_LEVEL) SendClientMessage(i, 0x2641FEAA, string);
}
}
return 1;
}
Re: help please -
bartje01 - 13.02.2010
can you please give an example with strmpcmd?
Re: help please -
LuxurioN™ - 13.02.2010
Try this: (Not Tested):
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[128];
new Color[MAX_PLAYERS];
Color[playerid] = GetPlayerColor(playerid);
if (strcmp("/cr", cmdtext, true, 3) == 0)
{
if(Color[playerid] == 0x2641FEAA)
{
if(strlen(cmdtext) <= 3)
return SendClientMessage(playerid,0xFF7F50AA,"Usage: /cr [Text]");
new pname[24];
GetPlayerName(playerid, pname, 24);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && Color[i] == 0x2641FEAA)
{
format(string, sizeof(string), "|COP|: %s(%d): %s",pname,playerid,cmdtext[4]);
SendClientMessage(i,0xFF7F50AA,string);
}
}
}
else return SendClientMessage(playerid,0xFF7F50AA,"ERROR: You not is COP!");
return 1;
}
return 0;
}
Re: help please -
bartje01 - 13.02.2010
AWesome. Thanksyou