Forum

> > Stranded II > Scripts > Playerdistance command using $values
Forums overviewStranded II overview Scripts overviewLog in to reply

English Playerdistance command using $values

2 replies
To the start Previous 1 Next To the start

old Playerdistance command using $values

Lion_Hearted
User Off Offline

Quote
Hi!

I'm trying to add the playerdistance command to this script.
Spoiler >


The above script works excellent, as far as I've seen...

The above script is for a hunting system that I'm trying to make, (check the English, stranded 2, general section) that involves the players hunting value, and distance from the target. and a certain amount of random factors...

However I want the playerdistance command to work on $tmp and $tmp2... the class and id of the impact.

Effectively doing this...


playerdistance "Class", ID

$dis=playerdistance"$tmp",$tmp2;

So of course I could do a simple line like this...
And of course... I need help with that too...

          if ($dis=>50,<=100){

old Re: Playerdistance command using $values

DC
Admin Off Offline

Quote
the above script uses wrong notation though.
1
elseif (skillvalue("hunt")>50,<=100){
this ","-thing is not supported. the correct way to express this would be two conditions combined with && (and):
1
elseif ((skillvalue("hunt")>50)&&(skillvalue("hunt")<=100)){

the playerdistance call would have to look like this (if that's what you are asking for?):
1
$dis=playerdistance($tmp,$tmp2);
note that you should never put " around variables and that you always need to use ( ) around the function-parameters if your function-call returns a value (the distance in this case).

and finally the condition at the end (same principle as above):
1
if (($dis=>50)&&($dis<=100)){
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview