Help with a chat
#1

how can I do in my server when someone write something to appears over the player
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerChatBubble
Reply
#3

it doesn't display it what i write
Reply
#4

Hi Boyan96,

Could you show us the code so we can try and diagnose the problem?

Cheers,

TJ
Reply
#5

Quote:
Originally Posted by boyan96
Посмотреть сообщение
it doesn't display it what i write
Did you try pressing on the "search button" ?
Reply
#6

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

...

You can't see it above your OWN head, others will see it though.
Reply
#7

i put SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000); in public OnPlayerText but when i write someting it doesn't appears over the player

PHP код:
public OnPlayerText(playeridtext[])
{
    new 
string[256];
    new 
tmp[256];
     
SetPlayerChatBubble(playeridtext0xFF0000FF100.010000);
    if(
PlayerInfo[playerid][pMuted] != 0)
    {
        
SendClientMessage(playeridCOLOR_ADMINCMD" You are muted, you cannot speak.");
        return 
0;
    }
    if(
CalculateStarted == 1)
    {
        switch (
CalculateEvent)
        {
            case 
1:
            {
                new 
idx;
                
tmp strtok(textidx);
                if ((
strcmp("49"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("49")))
                {
                    
CalculateStarted 0;
                    
CalculateEvent 0;
                    for(new 
0MAX_PLAYERSi++)
                    {
                        
KillTimer(reactiontimer[i]);
                    }
                    
PlayerInfo[playerid][pCWons] ++;
                    
GivePlayerCash(playerid20000);
                    
format(stringsizeof(string), "* %s has the fastest reaction of %.1f seconds. %s has won %d times before."PlayerName(playerid), PlayerInfo[playerid][pCalcSec], PlayerName(playerid), PlayerInfo[playerid][pCWons]);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
PlayerInfo[playerid][pCalcSec] = 0.0;
                }
            }
            case 
2:
            {
                new 
idx;
                
tmp strtok(textidx);
                if ((
strcmp("5.44"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("5.44")))
                {
                    
CalculateStarted 0;
                    
CalculateEvent 0;
                    for(new 
0MAX_PLAYERSi++)
                    {
                        
KillTimer(reactiontimer[i]);
                    }
                    
PlayerInfo[playerid][pCWons] ++;
                    
GivePlayerCash(playerid20000);
                    
format(stringsizeof(string), "* %s has the fastest reaction of %.1f seconds. %s has won %d times before."PlayerName(playerid), PlayerInfo[playerid][pCalcSec], PlayerName(playerid), PlayerInfo[playerid][pCWons]);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
PlayerInfo[playerid][pCalcSec] = 0.0;
                }
            }
            case 
3:
            {
                new 
idx;
                
tmp strtok(textidx);
                if ((
strcmp("10"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("10")))
                {
                    
CalculateStarted 0;
                    
CalculateEvent 0;
                    for(new 
0MAX_PLAYERSi++)
                    {
                        
KillTimer(reactiontimer[i]);
                    }
                    
PlayerInfo[playerid][pCWons] ++;
                    
GivePlayerCash(playerid20000);
                    
format(stringsizeof(string), "* %s has the fastest reaction of %.1f seconds. %s has won %d times before."PlayerName(playerid), PlayerInfo[playerid][pCalcSec], PlayerName(playerid), PlayerInfo[playerid][pCWons]);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
PlayerInfo[playerid][pCalcSec] = 0.0;
                }
            }
            case 
4:
            {
                new 
idx;
                
tmp strtok(textidx);
                if ((
strcmp("obama"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("blood")))
                {
                    
CalculateStarted 0;
                    
CalculateEvent 0;
                    for(new 
0MAX_PLAYERSi++)
                    {
                        
KillTimer(reactiontimer[i]);
                    }
                    
PlayerInfo[playerid][pCWons] ++;
                    
GivePlayerCash(playerid20000);
                    
format(stringsizeof(string), "* %s has the fastest reaction of %.1f seconds. %s has won %d times before."PlayerName(playerid), PlayerInfo[playerid][pCalcSec], PlayerName(playerid), PlayerInfo[playerid][pCWons]);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
PlayerInfo[playerid][pCalcSec] = 0.0;
                }
            }
            case 
5:
            {
                new 
idx;
                
tmp strtok(textidx);
                if ((
strcmp("blood"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("obama")))
                {
                    
CalculateStarted 0;
                    
CalculateEvent 0;
                    for(new 
0MAX_PLAYERSi++)
                    {
                        
KillTimer(reactiontimer[i]);
                    }
                    
PlayerInfo[playerid][pCWons] ++;
                    
GivePlayerCash(playerid20000);
                    
format(stringsizeof(string), "* %s has the fastest reaction of %.1f seconds. %s has won %d times before."PlayerName(playerid), PlayerInfo[playerid][pCalcSec], PlayerName(playerid), PlayerInfo[playerid][pCWons]);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
PlayerInfo[playerid][pCalcSec] = 0.0;
                }
            }
        }
    }
    if(
realchat)
    {
        
format(stringsizeof(string), "(%d): %s"playeridtext[0]);
        
SendPlayerMessageToAll(playeridstring);
        return 
0;
    }
    return 
1;

Reply
#8

Read this post.


Quote:
Originally Posted by PrawkC
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetPlayerChatBubble

...

You can't see it above your OWN head, others will see it though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)