The online racing simulator
privMsg( username,message )
privMsg( message )
privMsg can be used with userName or no



CASE "!pm":
$tmp = splitToArray( $argv,"," )
privMsg( $tmp[0], "You have received a private message from" . GetCurrentPlayer("UserName" ) );
privMsg( $tmp[0], $tmp[1] );

BREAK;


in chat just type
!pm gai-luron,hello my friend

or if you want absolutely this function create a sub like
in this case you haven't to change anything in your code

Sub userMsg( $userOrig,$userDest,$msg )
PrivMsg($userDest,"You have receive a message from " . $userOrig );
PrivMsg($userDest, $msg );
EndSub

aha :P well i figured out how to do that :P nice tho i didnt even think of that :P
i tired this

<?php 
         
CASE "!pm":
           IF( 
$argv != "" )   THEN
            $idxSpace 
indexOf$argv" ");
                                IF( 
$idxSpace != -THEN
            $toUser 
subStr$argv,0,$idxSpace );
            
$argv trimsubStr$argv,$idxSpace ) );
          
privMsg "^6PM To " GetPlayerVar$toUser "NickName" )  );
            
privMsg "^7" $argv );            
            
privMsg$toUser "^6PM From " GetCurrentPlayer("UserName" ) );
            
privMsg$toUser $argv );
  ELSE
             
privMsg "^7Command needs 2 paremters" );
 ENDIF
 ELSE
             
privMsg "^7Command needs 2 paremters" );
 ENDIF
 BREAK;
?>

but it didnt work
gai, i tries this and im in the zone but it says Command not available here

any idea?


<?php 
            
CASE "!buyfood":
                IF( 
GetCurrentPlayerVar"idZone") == "Store" THEN
                    privmsg
"You Just Bought " $argv " units of food." );
                ELSE
                    
privmsg"Command not available here");
                ENDIF
                Break;
?>


<?php 
    RegisterZoneAction
"Store" "AS5" , -101,432130 Test );
?>

idZone -> IdZone
i like how i can do this and it pm s the user i think it would be cleaner as "PM to: Me"
and "PM From: You"


<?php 
            privMsg
$toUser "^7" $argv ); 
?>

Create a sub that do this

Sub myPm( $from, $to, $msg )

privMsg( $to,"PM from " . $from );
privMsg( $to,$msg );

privMsg( $from,"PM to " . $to );
privMsg( $from,$msg );

EndSub

Don't forget you can create your own command! if i want to limit command to builtin command, i never dev GLScript and sub
Quote from Gai-Luron :Create a sub that do this

Sub myPm( $from, $to, $msg )

privMsg( $to,"PM from " . $from );
privMsg( $to,$msg );

privMsg( $from,"PM to " . $to );
privMsg( $from,$msg );

EndSub

Don't forget you can create your own command! if i want to limit command to builtin command, i never dev GLScript and sub

no i mean i tried that and it says that bye default :P

This is exactly my pm command


<?php 
        
CASE "!pm":
           IF( 
$argv != "" )   THEN
            $idxSpace 
indexOf$argv" ");
                                IF( 
$idxSpace != -THEN
            $toUser 
subStr$argv,0,$idxSpace );
            
$argv trimsubStr$argv,$idxSpace ) );
            
privMsg$toUser "^7" $argv );
  ELSE
             
privMsg "^7Command needs 2 paremters" );
 ENDIF
 ELSE
             
privMsg "^7Command needs 2 paremters" );
 ENDIF
 BREAK;
?>

and it says " you have received a private message from ..."

i just think it will look a lil better if it was "PM from ..."
Not on last version!
Hi Gai,
My Points System has stopped working.....

Error:12/15/2009 3:05:29 PM -> Syntax error in cfg file "./includes/Points_System.lpr" at line #29
Incorrect number of parenthesis
Function 'onresult' script aborted

Line 29:IF(( $flagConfirm == 2 )||( $flagConfirm == 18 )||( $flagConfirm == 34 )) THEN
SetCurrentPlayerVar("Race_Points",GetUserStoredValue("Race_Points"));
SetCurrentPlayerVar("Race_Points",GetCurrentPlayerVar("Race_Points")+ $ps_points);
SetUserStoredValue("Race_Points", GetCurrentPlayerVar("Race_Points"));
ENDIF


Any Ideas Why ?
Do you change anything in your script?

if yes the error can be localised in previous line

wich LFSLapper version?

Gai-Luron
Hi Gai,
Previous line is....
CASE 1:

I have changed nothing in that file and LFSLapper version is in my signature below

Gai is this line OK
EVENT OnResult($UserName,$flagConfirm )

is UserName case sensitive in Player Events
Hi Andy,

Line 29:IF(( $flagConfirm == 2 )||( $flagConfirm == 18 )||( $flagConfirm == 34 )) THEN

must be ( in ver. 5.911 or 5.912 )

IF( $flagConfirm == 2 || $flagConfirm == 18 || $flagConfirm == 34 ) THEN

No reason to have this syntax, maybe a bug. I take a look


Gai-Luron
ok im making prices and i was wondering if i could do
SetLapperVar( "Price_UF1", "2000" );
use global var
Quote from Andy King :Hi Gai,
Previous line is....
CASE 1:

I have changed nothing in that file and LFSLapper version is in my signature below

Gai is this line OK
EVENT OnResult($UserName,$flagConfirm )

is UserName case sensitive in Player Events

Hi Gai any news on this problem?
Quote from Andy King :Hi Gai any news on this problem?

Hi Andy,

This works for your line 29

IF( $flagConfirm == 2 || $flagConfirm == 18 || $flagConfirm == 34 )
THEN

In your line is the syntax changed (remove the red ( and ) and it works.
Line 29:IF(( $flagConfirm == 2 )||( $flagConfirm == 18 )||( $flagConfirm == 34 )) THEN

The line EVENT OnResult($UserName,$flagConfirm ) is OK.
Hi Tim,
Thanks that works perfectly again.
And array

$Price[$argv]
The big question is : What do you want to do????

$Price[500] = "This is one var";
$Price["MyVar"] = "This a other var";

WriteLine( $Price[500] ) ; // Display on console "This is one var"
WriteLine( $Price["MyVar"] ) ; // Display on console "This a other var"
Quote from Gai-Luron :The big question is : What do you want to do????

$Price[500] = "This is one var";
$Price["MyVar"] = "This a other var";

WriteLine( $Price[500] ) ; // Display on console "This is one var"
WriteLine( $Price["MyVar"] ) ; // Display on console "This a other var"

Well i need to set up car prices for cruise insim
$price["XFG"] = 1000;
$price["XRT"] = 2000;

WriteLine( "Price for XFG is " . $price["XFG"] );
This thread is closed

Config help
(1112 posts, closed, started )
FGED GREDG RDFGDR GSFDG