Help with a chat
#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


Messages In This Thread
Help with a chat - by boyan96 - 30.08.2011, 11:11
Re: Help with a chat - by =WoR=Varth - 30.08.2011, 11:13
Re: Help with a chat - by boyan96 - 30.08.2011, 11:23
Re: Help with a chat - by TTJJ - 30.08.2011, 11:25
Re: Help with a chat - by =WoR=G4M3Ov3r - 30.08.2011, 11:26
Re: Help with a chat - by PrawkC - 30.08.2011, 11:28
Re: Help with a chat - by boyan96 - 30.08.2011, 11:29
Re: Help with a chat - by =WoR=Varth - 30.08.2011, 11:34

Forum Jump:


Users browsing this thread: 2 Guest(s)