The online racing simulator
New Function
Hello, I wanted to make a request and know if it could be done by Bass-Driver, the request would be if you can add a new one to a function similar to that of "ClosePrivButton" but that new function is "CloseSub" that would fulfill the same function as the Of "ClosePrivButton" function would disable a "Sub Event" not if I explain myself well ....

I hope this feature can be created because it would help close things with more fluidity than closing a button


SPANISH

Buenas quería hacer una petición y saber si podría ser realizada por Bass-Driver, la petición sería si se puede agregar una nueva a función parecida a la de "ClosePrivButton" pero que está nueva función sea "CloseSub" que cumpliría la misma función que la de "ClosePrivButton" la función sería desactivar un "Sub Evento" no se si me explico bien....

Espero se pueda crear esta función ya que ayudaría a cerrar cosas con mayor fluidez que cerrar de a 1 botón
Maybe I am not understanding the request, but why would you want such function?
I mean, it's very easy to user either a GlobalVar or a PlayerVar to act like a switch that decides if a sub is or isn't executed.
@Popughini

Here's an examplecode for display players speed, that i used in a another topic.
With the 2 commands you can control a loop inside a Sub



<?php 
###################################
#Event triggered when lapper start#
###################################
Event OnLapperStart()
    
Globalvar $Loop_On
        
$Loop_On 0;
EndEvent

#################
#Command actions#
#################
Event 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 
"!loopoff":
            
$Loop_On 0;
            
$Racers GetListOfPlayers("U");                  
            FOREACH( 
$Var IN $Racers )
                
closeButton$Var["value"], "speed");
            ENDFOREACH
        BREAK;
        
        CASE 
"!loopon":
            
$Loop_On 1;
            
globalmsg("execute sub Set_Loop()");
            
Set_Loop();
        BREAK;

    ENDSWITCH
EndEvent

Sub Set_Loop
()
    IF (
$Loop_On == 1THEN 
        $Racers 
GetListOfPlayers("U");                  
        FOREACH( 
$Var IN $Racers #For each player in the server
            
openButton$Var["value"], "speed",175,124,25,5,5,2,96,"^7" GetPlayerVar$Var["value"], "InstantSpeed") . " " GetPlayerVar$Var["value"], "UnitSpeed")."^8 (".GetPlayerVar$Var["value"], "Car").")");
            
DelayedCommand1Set_Loop); #1 second delay
        
ENDFOREACH
    ENDIF
EndSub

?>


Quote from Bass-Driver :@Popughini

Here's an examplecode for display players speed, that i used in a another topic.
With the 2 commands you can control a loop inside a Sub



<?php 
###################################
#Event triggered when lapper start#
###################################
Event OnLapperStart()
    
Globalvar $Loop_On
        
$Loop_On 0;
EndEvent

#################
#Command actions#
#################
Event 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 
"!loopoff":
            
$Loop_On 0;
            
$Racers GetListOfPlayers("U");                  
            FOREACH( 
$Var IN $Racers )
                
closeButton$Var["value"], "speed");
            ENDFOREACH
        BREAK;
        
        CASE 
"!loopon":
            
$Loop_On 1;
            
globalmsg("execute sub Set_Loop()");
            
Set_Loop();
        BREAK;

    ENDSWITCH
EndEvent

Sub Set_Loop
()
    IF (
$Loop_On == 1THEN 
        $Racers 
GetListOfPlayers("U");                  
        FOREACH( 
$Var IN $Racers #For each player in the server
            
openButton$Var["value"], "speed",175,124,25,5,5,2,96,"^7" GetPlayerVar$Var["value"], "InstantSpeed") . " " GetPlayerVar$Var["value"], "UnitSpeed")."^8 (".GetPlayerVar$Var["value"], "Car").")");
            
DelayedCommand1Set_Loop); #1 second delay
        
ENDFOREACH
    ENDIF
EndSub

?>



But how can I make a button when I click to close a Sub?
its easy, just think a little bit more. After all your lapperrequests.


<?php 
Sub loop
()
    
openButton$Var["value"], "button",175,124,25,5,5,2,96,"^7",Clickbutton);
EndSub

Sub Clickbutton
($KeyFlags,$id)
    
$Loop_On 0;
EndSub
?>



FGED GREDG RDFGDR GSFDG