Raised This Month: $ Target: $400
 0% 

Give player a radius?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 12-06-2006 , 19:05   Re: Give player a radius?
Reply With Quote #7

Hi, here is the code i'm using and it is hooked to a set_task. It doesn't do what its supposed to though. Can anyone fix it for me?

Code:
public checkPass(id) {          for(new player1 = 1; player1 <= get_playersnum(); player1++) {         for(new player2 = 1; player2 <= get_playersnum(); player2++) {             if( (is_user_alive(player1) && is_user_alive(player2)) && (is_user_connected(player1) && is_user_connected(player2)) ) {                 if(!(player1 == player2)) {                     new distance;                     new origin1[3], origin2[3];                     new radius = 100;                                         get_user_origin(player1, origin1);                     get_user_origin(player2, origin2);                     distance = get_distance(origin1, origin2);                     if(distance < radius) {                         entity_set_int(player1, EV_INT_solid, SOLID_NOT);                         entity_set_int(player2, EV_INT_solid, SOLID_NOT);                     } else {                         entity_set_int(player1, EV_INT_solid, SOLID_BBOX);                         entity_set_int(player2, EV_INT_solid, SOLID_BBOX);                     }                 }             }         }     }     return PLUGIN_CONTINUE; }
hlstriker is offline
 



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 06:59.


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