The online racing simulator
[Solved]Message button
Hello, I come to make this post why I need help with a command ...

What I want to do is that the command shows the messages that you write ...

Example:!

And in the button the message "Xuser: hello" appears but it does not work for me: s

Thanks in advance !


<?php 
        
CASE "!msg":
        
OpenGlobalButton"mensajeadmin1",63,30,79,12,4,5,23,"" );
        
OpenGlobalButton"mensajeadmin2",63,30,79,12,4,5,23,"" );
        
OpenGlobalButton"mensajeadmin3",63,30,79,12,4,5,23,"" );
        
OpenGlobalButton"mensajeadmin4",64,31,77,10,4,5,32,"" );
        
OpenGlobalButton"mensajeadmin5",64,31,77,10,4,5,32,"" );
        
OpenGlobalButton"mensajeadmin6",64,31,77,10,4,5,32,GetCurrentPlayerVar"NickName" ) . "^7 : " $argv " );
        BREAK;
?>


So every command you type must be shown to the players?

The code should work, if you want to display the text someone typed.
OpenGlobalButton( "mensajeadmin1",63,30,79,12,4,5,23,"" );
What is 23? should be 32? (Dark button)
Yes, they are dark and white buttons
and?
Did you fixed the buttons? Do they work now?

Please give us more information about the work you have done.
Otherwise it will be a endless thread.
** Best answer **
I wrote this code to send messages to everyone on the server.
The text isn't appearing in a button though, but as a Race Control Message.


<?php 
CatchEvent OnMSO
$userName$text # Player event
    
$idxOfFirtsSpace indexOf$text" ");

    IF( 
$idxOfFirtsSpace == -THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirtsSpace );
      
$argv trimsubStr$text,$idxOfFirtsSpace ) );
    ENDIF

    SWITCH( 
$command )
        CASE 
"!msg":
            IF( 
UserInGroup"admin"$userName ) == )
            
THEN
              openPrivButton
"send_msg",52,0,48,5,5,-1,32,"^3Click to resend message: %nl%" .GetCurrentPlayerVar ("message"),rcm_msg );
              
openPrivButton"write_send_msg_bg",100,0,48,10,5,-1,32,"" );
              
openPrivTextButton"write_send_msg",100,5,48,5,5,0,"^3Write message and click OK (max. 50 characters)","^2Click to type and send a message",50,rcm_written_msg );
              
openPrivButton"close_msg",148,0,10,10,5,-1,32,"^1X",close_msg );
            ELSE
              
privMsg"^1You are not allowed to open that");
            ENDIF
            BREAK;
    ENDSWITCH
EndCatchEvent

Sub rcm_written_msg 
$KeyFlags $message )
    
SetCurrentPlayerVar ("message""^2".$message);

    
cmdLFS "/rcm ^2" $message );
    
cmdLFS "/rcm_all" );
    
openPrivButton"send_msg",52,0,48,5,5,-1,32,"^3Resend message: %nl%^8" .GetCurrentPlayerVar ("message"),rcm_msg );
EndSub

Sub rcm_msg 
$KeyFlags $argv )
    
cmdLFS "/rcm ^2" GetCurrentPlayerVar "message" ) );
    
cmdLFS "/rcm_all" );
EndSub

Sub close_msg 
$KeyFlags $argv )
    
closePrivButton "send_msg&write_send_msg_bg&write_send_msg&close_msg" );
EndSub
?>


Thanks, it worked for me, but what I wanted was for the text to appear on a button ....
Quote from Popughini :Thanks, it worked for me, but what I wanted was for the text to appear on a button ....

I already said it was a RCM and not a text on a button, but the code I gave, should be more then enough to be able to put the text on a button.
We can't do all the work for you Wink
Yes, I noticed, I already added a button
This thread is closed

FGED GREDG RDFGDR GSFDG