A lot of space beetwen my texts?
#1

Hi guys i just did that script :

PHP код:
new string[128];
    if(
AdminLevel[playerid] == 1)
    {
        
format(string,sizeof(string),"%s {8B0000}[Administrateur]{FFFFFF}: %s",pname,text);
        
SendClientMessageToAll(COLOR_WHITE,string);
        return 
0;
    } 
Under the OnPlayerText,

But i leaves a lot of space when i send a text in Game :



What should i do ?
Reply
#2

Paste all your onplayertext here please.
Reply
#3

PHP код:
PUBLIC:OnPlayerText(playeridtext[])
{
    new 
pname[24];
    
GetPlayerName(playerid,pname,sizeof(pname));
    
    
//Le chat Bubble
    
if(AdminLevel[playerid] < 1)
    {
        
SetPlayerChatBubble(playeridtext0xFF0000AA100.010000);
        return 
1;
    }
    
    
//Le test du reaction
    
    
switch(xTestBusy)
        {
            case 
true:
            {
                        if(!
strcmp(xCharstextfalse))
                        {
                            new
                                
string[128],
                                
pName[MAX_PLAYER_NAME]
                                ;
                                
GetPlayerName(playeridpNamesizeof(pName));
                                
format(stringsizeof(string), "« \%s[%d]\" a rйussi au test du rйaction. »"pName,playerid);
                            
SendClientMessageToAll(GREENstring);
                            
format(stringsizeof(string), "« Vous recevez $%d + %d score et points pour rйussir au test du rйaction. »"xCashxScore);
                            
SendClientMessage(playeridGREENstring);
                            
GivePlayerMoney(playeridxCash);
                                
SetPlayerScore(playeridGetPlayerScore(playerid) + xScore);
                                
xReactionTimer SetTimer("xReactionTest"TIME1);
                            
xTestBusy false;
                        }
                }
        }
    
//Tchat Message
    
new string2[1024];
    if(
AdminLevel[playerid] < 1)
    
format(string2,sizeof(string2),"{%06x}%s[%d]: {FFFFFF}%s",GetPlayerColor(playerid) >>> 8,pname,playerid,text);
    
SendSplitMessageChat(COLOR_WHITE,string2);
    
    
//Faction des Administrateurs
    
new string[128];
    if(
AdminLevel[playerid] == 1)
    {
        
format(string,sizeof(string),"%s {8B0000}[Administrateur]{FFFFFF}: %s",pname,text);
        
SendClientMessageToAll(COLOR_WHITE,string);
        return 
0;
    }
    
    return 
0;

Reply
#4

pawn Код:
if(AdminLevel[playerid] < 1)
format(string2,sizeof(string2),"{%06x}%s[%d]: {FFFFFF}%s",GetPlayerColor(playerid) >>> 8,pname,playerid,text);
SendSplitMessageChat(COLOR_WHITE,string2);
If the level is >= 1, it won't format the text so basically "string2" is empty. The SendSplitMessageChat might not check about 0 length and send an empty message. For more than 1 function in a statement, use brackets {}.
Reply
#5

//Faction des Administrateurs
new string[128];
if(AdminLevel[playerid] == 1)
{
format(string,sizeof(string),"%s {8B0000}[Administrateur]{FFFFFF}: %s",pname,text);
SendClientMessageToAll(COLOR_WHITE,string);
return 0;
}

This is the code for Administrator xD

Here where's the problem
Reply
#6

Worked, with Brackets.

Thanks, +Rep !
Reply
#7

Hello KillerDVX, the problem wasn't the brackets. The problem is that you don't writed return 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)