Raised This Month: $ Target: $400
 0% 

Comparing Origin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-06-2012 , 11:55   Comparing Origin
Reply With Quote #1

How would i compare a user's origin (checking to see if they haven't moved) within a task.

I have this code....but it isn't working.

PHP Code:
public task_giveHealth(in[])
{
    new 
id str_to_num(in)
    
client_print(idprint_chat"Health Task....")
    new 
now[3], then[3]
    
get_user_origin(idnow)
    
    if(!
healthOrigin[id][0])
    {
        for(new 
03i++)
            
healthOrigin[id][i] = now[i]
    }
        
        
    
healthOrigin[id] = then
    
if(compareOrigin(nowthen) && healthGain[id] < 40)
    {
        
client_print(idprint_chat"Health Given")
        new 
health get_user_health(id) + 3
        set_user_health
(idhealth)
        
healthGain[id]+= 3
    
}
    else
        
remove_task(1)
}

    
// @RETURNS: 1 if equal; -[index] if not equal
stock compareOrigin(now[3], then[3])
{
    if(
now[0] != then[0])
        return 
0
    
else if(now[1] != then[1])
        return -
1
    
else if(now[2] != then[2])
        return -
2
        
    
return 1

__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode