![]() |
Distance @timer - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Distance @timer (/Thread-Distance-timer) |
Distance @timer - Rizz - 04-26-2015 06:29 AM PHP Code: ON=@TIMER I can't say it's not working but... it gives me 1520+<distance> Did i wrong something lol? I tried this way: PHP Code: [FUNCTION f_magery_target_distance] The function works in game but doesn't work if i call from the @timer trigger RE: Distance @timer - Coruja - 04-26-2015 07:49 AM REFx is not a global reference to an object, so you must define it again when using on @Timer Code: ON=@Timer PS: you can't use triggers directly inside [functions] templates ![]() RE: Distance @timer - Rizz - 04-26-2015 08:09 AM Refx are set under @timer, i just didn't copy here, i know they are not global lol Infact the funcion works and gives me the two names but cannot resolve the coord. The originale one is: PHP Code: on=@timer And as i told you, the serv.b names works correctly but not the distance. RE: Distance @timer - XuN - 04-27-2015 02:56 AM <argn> means ARG Numeric while <args> means ARG String (fast explanation), since UIDs are hexadecimal values and also have strings the argn value will not be read probably, use <args> instead, <argv0> or <argv[0]>. RE: Distance @timer - Rizz - 04-27-2015 03:43 AM Still the same problem, i cannot get the distance: Can't resolve <ref1.distance> It works only if i type in game .f_magery_target_distance <uid> RE: Distance @timer - Rizz - 04-27-2015 05:22 AM I decided to fix in this way: Code: [FUNCTION f_magery_target_distance] Normal distance and distance found in that way is almost the same but sometimes they have a difference of 1 tile. Is a truncation problem? How sphere calculates it? Is just a difference between p.x and p.y and you take the biggest one? |