OnPlayerText Help [+REP] -
Biggy54 - 23.09.2014
Hello, I'm trying to make a script.
The script is:
When an admin types something, the thing which the admin typed should appear in the main chat without the sender's name.
Thanks, please help.
Re: OnPlayerText Help [+REP] -
DavidBilla - 23.09.2014
You need to return 0 in OnPlayerText and make a format of how each player's text will be shown
The admin text would be similar to
pawn Код:
new string[128];
format(string,sizeof(string),"%s",text);
SendClientMessageToAll(-1,string);
Re: OnPlayerText Help [+REP] -
Biggy54 - 23.09.2014
Sorry, but can you make me a full code?
Re: OnPlayerText Help [+REP] -
PMH - 23.09.2014
pawn Код:
public OnPlayerText(playerid, text[])
{
if(IsPlayerAdmin(playerid)
{
SendClientMessageToAll(-1, text);
return 1;
}
return 1;
}
u need to be rcon admin ^^ may work, may not
Re: OnPlayerText Help [+REP] -
XStormiest - 23.09.2014
pawn Код:
public OnPlayerText(playerid, text[])
{
// if player is Admin, in this case : RCON ADMIN, your desired message is send
if(IsPlayerAdmin(playerid)) // replace IsPlayerAdmin([playerid) with your Admin system's function!
{
new string[256];
format(string, sizeof(string), "%s", text);
SendClientMessageToAll(-1, string);
}
else // but if the player is not admin, then an ordinary message is send.
{
new string1[256];
format(string1, sizeof(string1), "%s:{FFFFFF} %s", text);
SendClientMessageToAll(GetPlayerColor(playerid), string1);
}
return 0; // disables the defalt SA-MP chat so we can make custom chat
}
Re : OnPlayerText Help [+REP] -
streetpeace - 23.09.2014
pawn Код:
public OnPlayerText(playerid, text[])
{
if(IsPlayerAdmin(playerid))
{
format(string, sizeof(string), "Administrator says : %s", text);
SendClientMessageToAll(-1, string);
return 1;
}
return 1;
}
Like this ?
Re: OnPlayerText Help [+REP] -
XStormiest - 23.09.2014
What your code does is:
Sending Default Message: like: (Playercolor)Playername
white)text
and also will send
Administrator says: text, but with white.
Try to look at my code, is the one above.
Re: OnPlayerText Help [+REP] -
M0HAMMAD - 23.09.2014
pawn Код:
public OnPlayerText(playerid, text[])
{
if(IsPlayerAdmin(playerid))
{
new string[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string,sizeof(string),"{40E0D0}[ADMIN] {%06x}%s(%d): {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, name, playerid, text);
SendClientMessageToAll(-1, string);
return 0;
}
return 1;
}
Re: OnPlayerText Help [+REP] -
Biggy54 - 24.09.2014
Thank y'all