SA-MP Forums Archive
OnPlayerText - 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: OnPlayerText (/showthread.php?tid=112537)



OnPlayerText - _Sami_ - 08.12.2009

Код:
public OnPlayerText(playerid, text[])
{

if( muted[playerid] == 1)
if(strlen(text) > 0) SendClientMessage(playerid,COLOR_DARKRED, "You are temporarily muted.");

return 1;
  }
it sending message to player but he can still chat ?


Re: OnPlayerText - Correlli - 08.12.2009

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(muted[playerid] == 1)
  {
    SendClientMessage(playerid, COLOR_DARKRED, "You are temporarily muted.");
    return 0;
  }
  return 1;
}



Re: OnPlayerText - _Sami_ - 08.12.2009

thanks it worked and yes
Код:
stock Admin(msg[])
{
  for(new i 0; i<GetMaxPlayers(); i++
  {
    if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i,white,msg);
  }
}

i want to use it in this command and when the player types this so for rcon Admins print "someone used /setskin"
but i doesnt know how to ?
Код:
if(strcmp(cmd, "/setskin", true) == 0) {
    new tmp[256];

    if(!cmdtext[8])return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /setskin [skinid]");
    tmp = strtok(cmdtext, idx);
		SetPlayerSkin(playerid,strval(tmp));
			SendClientMessage(playerid, COLOR_YELLOW, "Skin Changed.");
	  return 1;
	}



Re: OnPlayerText - Correlli - 08.12.2009

Basic code:
pawn Код:
new
    myArray[50];
GetPlayerName(playerid, myArray, MAX_PLAYER_NAME);
format(myArray, sizeof(myArray), "%s used /setskin command.", myArray);
Admin(myArray);
Wrong:
Quote:
Originally Posted by Sami_
Код:
stock Admin(msg[])
{
  for(new i 0; i<GetMaxPlayers(); i++
  {
    if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i,white,msg);
  }
}
Correct:
pawn Код:
stock Admin(msg[])
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i, white, msg);
  }
}



Re: OnPlayerText - _Sami_ - 08.12.2009

thanks .


Re: OnPlayerText - Correlli - 08.12.2009

You're welcome.