help plz - 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 plz (
/showthread.php?tid=127493)
help plz -
bartje01 - 13.02.2010
Hey guys. I have this script:
Код:
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), "|Officer|: %s(%d): %s",pname,playerid,cmdtext[4]);
SendClientMessage(i,0xFF7F50AA,string);
}
}
}
else return SendClientMessage(playerid,0xFF7F50AA,"ERROR: You are not a cop.");
return 1;
}
Why do only I see the text when I do /cr blablabla.?
Nobody else is seeing it. Please help
Re: help plz -
Luca Dimonte - 14.02.2010
Maybe because nobody else has your colour. Every player has to match these both conditions
if(
IsPlayerConnected(i) &&
Color[ i ] == 0x2641FEAA)
so if the player is connected and code is never read then his color is not 0x2641FEAA. Check where do you assign Color[] for each of all the players.