View Single Post
  #4  
Old 07-31-2017, 02:57 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is just really niceMysticalDragon is just really nice
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
sleep(1) is more like waitfor(this, "none", 1) in GS2 the benefit of this it doesn't stop the execution of the script, that's my preferred method If its viable. scheduleevent can call a function on a timer basis. Basically It wont trigger the function immediately but when it hits the timer. Its better then timeout since it can be called once. Although I seen some people set there setTimer(0) (not sure if that even works, never tried it), which is ugly in my opinion. Reason I used this is because like your join classes, It's good to have one centralized place for repetitive code. instead of adding this.chat = "" after ever function its only in one place. Format just organized your code in a readability type way. Instead of doing things like,

PHP Code:
echo("test1:" SPC temp.test1 SPC "test2:"SPC temp.test2 SPC "test3:"SPC temp.test3
which looks horrible you could do

PHP Code:
echo(format("test1: %s test2: %s test3: %s"temp.test1temp.test2temp.test3)); 
It also can be used to replace parts of a string. Without using replacetext which could be intensive in some instances.

PHP Code:
   temp.copy_id player.account;
   
temp.level findlevel(format("mylevel-%s.nw"temp.copy_id)); 
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]




Last edited by MysticalDragon; 07-31-2017 at 03:21 AM..
Reply With Quote