SetPlayerChatBubble <- How?
#1

So i want to have the function, that if player types something, ex Hello, it displays it on his/her head and after that it dissappears from there after like 5 secs. How can i do it? Thanks to those who help.
Reply
#2

lol its on the wiki

https://sampwiki.blast.hk/wiki/SetPlayerChatBubble

pawn Код:
public OnPlayerText(playerid, text[])
{
  SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
  return 1; // Only thing here, change it to return 0;
}
Reply
#3

I know, but if i currently have this code in my script:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new giver[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new tmp[256];
    new string[256];
    new giveplayerid;
  new str[160];

  GetPlayerName(playerid, str, MAX_PLAYER_NAME);

  for (new i = 0; i < MAX_PLAYER_NAME; i++)
  if (str[i] == '_')
  str[i] = ' ';
  if(PlayerInfo[playerid][pMuted] == 1)
    {
        SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
        return 0;
How do i change it than, if i want those bubbles?
Reply
#4

pawn Код:
public OnPlayerText(playerid,text[])
{
SetPlayerChatBubble(playerid,text,0xFFFFFFFF,25,5000); // Do some research for more options
}
Just throw this in there somewhere...
Reply
#5

I'd get error that symbol aready defined: OnPlayerText. So, i change

pawn Код:
public OnPlayerText(playerid, text[])
{
    new giver[MAX_PLAYER_NAME];
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new tmp[256];
    new string[256];
    new giveplayerid;
  new str[160];

  GetPlayerName(playerid, str, MAX_PLAYER_NAME);

  for (new i = 0; i < MAX_PLAYER_NAME; i++)
  if (str[i] == '_')
  str[i] = ' ';
  if(PlayerInfo[playerid][pMuted] == 1)
    {
        SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
        return 0;
to:

pawn Код:
public OnPlayerText(playerid,text[])
{
SetPlayerChatBubble(playerid,text,0xFFFFFFFF,25,5000);
}
if(PlayerInfo[playerid][pMuted] == 1)
    {
        SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
        return 0;
?
Reply
#6

Well you can only have one public OnPlayerText(playerid,text[]), but yea, test it out, see what you come up with etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)