Hello everyone!
I have made a job system where it will randomly generate a location name and coordinates to a specific area.
What I have realized is, If location 1 generated a random location THAT IS THE SAME
The player can simply finish the job without moving a finger at the same place.
I added this code below
$RandomLocation = round(ToNum(RandomNum(0,13)),0)."";
Result:
But one issue again, if it generates location 1 THEN ignores it, then the player has no location to go to, and therefore the job isn't set.
Any solutions would be highly appreciated!
I have made a job system where it will randomly generate a location name and coordinates to a specific area.
<?php
#Random Locations
GlobalVar $RandomLoc; $RandomLoc[0] = "0"; $RandomLoc[1] = "1"; $RandomLoc[2] = "2";
$RandomLoc[3] = "3"; $RandomLoc[4] = "4"; $RandomLoc[5] = "5"; $RandomLoc[6] = "6";
$RandomLoc[7] = "7"; $RandomLoc[8] = "8"; $RandomLoc[9] = "9"; $RandomLoc[10] = "10"
$RandomLoc[11] = "11"; $RandomLoc[12] = "12"; $RandomLoc[13] = "13";
#Location number 1
CASE "1":
$RandomLocation = round(ToNum(RandomNum(0,13)),0)."";
SetCurrentPlayerVar("CurrentJob", $RandomLoc[ToNum($RandomLocation)]);
PrivMsg("^7Delivery text example to ^3" . $RandomLoc[ToNum($RandomLocation)]);
BREAK;
?>
The player can simply finish the job without moving a finger at the same place.
I added this code below
$RandomLocation = round(ToNum(RandomNum(0,13)),0)."";
Result:
<?php
#Avoid generating location number 1 at location number 1.
IF (ToNum($RandomLocation != 1))
THEN
#Set current job blah..
ENDIF
?>
Any solutions would be highly appreciated!