display button distance code ??


<?php
#################################################
#Action when a predefined dist is done by player#
# Minimum dist is 100 meters
# -1 deactivate this feature
#################################################
$distToDo = 100;
Event OnDistDone( $userName ) # Player event
EndEvent
?>
SetPlayervar($userName,"DistXFG",(GetPlayerVar($userName,"DistXFG")+$distToDo));
SetStoredValue("varname", $value) - sets a variable
GetStoredValue("varname") - returns variable as a string
GetStoredNum("varname") - returns variable as a numeric (or as -1 if it's not a number), so you don't need to do a ToNum($var) conversion if you're doing numeric comparisons
SetUserStoredValue($username, "varname", $value) - Sets a variable
GetUserStoredValue($username, "varname") - returns variable as a string
GetUserStoredNum($username, "varname") - returns variable as a numeric
openPrivButton( "totaldistance",75,111,50,10,5,-1,ISB_DARK, GetPlayerVar($userName,"DistXFG");