<?php
Sub MultiStrReplace( $String, $Find, $Replace )
$Find = splitToArray( $Find,"|" );
$Replace = splitToArray( $Replace,"|" );
IF(arrayCount($Find) == arrayCount($Replace) ) THEN
$DONE = FALSE;
$NewString = $String;
WHILE ( $DONE == FALSE )
FOR ($i=0;$i<=arrayCount($Find);$i=$i+1)
$FindIndex = indexOf($NewString, $Find[$i]);
IF ( $FindIndex == -1 )
THEN
$DONE = TRUE;
ELSE
$Split1 = subStr( $NewString ,0, $FindIndex );
$SplitMid = strLen($Split1) + strLen($Find[$i]);
$Split2 = subStr( $NewString ,$SplitMid, strLen($NewString) - $SplitMid );
$NewString = $Split1 . $Replace[$i] . $Split2;
ENDIF
ENDFOR
ENDWHILE
return ($NewString);
ELSE
return ("^1ERROR: ^7Could Not Convert String");
ENDIF
EndSub
?>
<?php
MultiStrReplace( "Bob is a Cat Jack is also a Cat", "Cat|Bob", "Dog|Tom" )
# or another example
MultiStrReplace( "Bob is a Cat Jack is also a Cat", " Jack is also a Cat|Bob|Cat", "!|That Guy|Legend" )
?>
<?php
Sub StrReplace( $String, $Find, $Replace )
$SplitString = splitToArray( $String ,$Find );
$i = 0;
$total = arrayCount( $SplitString );
WHILE ($i <= $total)
$NewString = $NewString . $SplitString[$i] . $Replace;
$i = $i + 1;
ENDWHILE
return ($NewString);
EndSub
?>
<?php
GlobalVar $HLP_CRUISE; $HLP_CRUISE = "Cruise";
$GUI_HELP_ITEMS = "Cruise,"$GUI_HELP_ITEMS;
?>
<?php
GlobalVar $HLP_CRUISE; $HLP_CRUISE = "Cruise";
$GUI_HELP_ITEMS = $GUI_HELP_ITEMS.",Cruise";
?>
<?php
gui_help_contents_Cruise = "^2General Player commands"
. "%nl%^3!cruiseh ^8- Shows this help"
. "%nl%^3!km ^8- Show current amount of km you have"
. "%nl%^3!cash ^8- Show current amount of cash you have"
. "%nl%^3!cars ^8- Show the current cars you own"
. "%nl%^3!show ^8- Shows Everyone Your Stats"
. "%nl%^3!buy [car] ^8- Buy the listed car"
. "%nl%^3!sell [car] ^8- Sell the listed car"
. "%nl%^3!pitlane ^8- Sends you to pitlane"
. "%nl%^3!price [car] ^8- Display price of the listed car"
. "%nl%^3!send [amount] [user] ^8- sends the listed amount of cash to the listed user"
. "%nl%^3!pitsafe ^8- Displays whether your safe to pit"
. "%nl%^3!officer ^8- Go on/off duty"
. "%nl%"
. "%nl%^2Police Commands"
. "%nl%^7!chase [user]"
. "%nl%^6!unchase"
. "%nl%^7!Fine [amount]"
. "%nl%^6!clock [user]";
?>