SA-MP Forums Archive
Help with a chat - 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)
+--- Thread: Help with a chat (/showthread.php?tid=280077)



Help with a chat - boyan96 - 30.08.2011

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


Re: Help with a chat - =WoR=Varth - 30.08.2011

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


Re: Help with a chat - boyan96 - 30.08.2011

it doesn't display it what i write


Re: Help with a chat - TTJJ - 30.08.2011

Hi Boyan96,

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

Cheers,

TJ


Re: Help with a chat - =WoR=G4M3Ov3r - 30.08.2011

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


Re: Help with a chat - PrawkC - 30.08.2011

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

...

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


Re: Help with a chat - boyan96 - 30.08.2011

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;




Re: Help with a chat - =WoR=Varth - 30.08.2011

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.