Hello to all new LFSLapper users
In this topic, i will do a fast explaination, how to add commands in LFSLapper.
                
            In this topic, i will do a fast explaination, how to add commands in LFSLapper.
- 1) Open the 'LFSLapper.LPR' file in the 'default' folder (LFSLapper V7.0.4.6\bin\default\LFSLapper.LPR) with any texteditor application.
 - 2) Scroll down the file until you see the Event named "OnMSO"
This should look like this:
 
<?php 
Event OnMSO( $userName, $text ) # Player event
    $idxOfFirtsSpace = indexOf( $text, " ");
    IF( $idxOfFirtsSpace == -1 ) THEN
      $command = $text;
      $argv = "";
    ELSE
      $command = subStr( $text,0,$idxOfFirtsSpace );
      $argv = trim( subStr( $text,$idxOfFirtsSpace ) );
    ENDIF
    
    SWITCH( $command )
     
    ENDSWITCH
EndEvent
?>
- 3) Between SWITCH( $command ) and ENDSWITCH you can create CASE commands which is necessary for creating your own commands. This should look like this.
 
<?php 
SWITCH( $command )
    CASE "!yourcommand":
    #Yourcode
    BREAK;        
ENDSWITCH
?>
- 4) Between CASE "!yourcommand": and BREAK; you can add your code. In the LFSLapper.LPR file there already some examples you can use ingame.
 
