View Single Post
  #21  
Old 02-07-2010, 07:35 AM
Engine Engine is offline
Registered User
Join Date: Jan 2010
Posts: 70
Engine is on a distinguished road
Thanks for the awesome explanation Chris and Dusty. I have another question, is there a better way to have a more accurate hit detection? I tried making a showpoly that would show me the area being hit but it doesn't seem to hit correctly in the box.
PHP Code:
function onActionServerSide(hittxhitty) {
  
this.range = - 3;
  for (
plfindNearestPlayers(player.xplayer.y)) {
    if (
pl.account != player.account) {
      if (
pl.x in hittx this.rangehittx | && pl.y in hitty this.rangehitty | ) {
       
//Do stuff
      
}
    }
  }
}
//#CLIENTSIDE
function onKeyPressed() {
  if (
keydown(6)) {
    
temp.hitx player.1.4 vecx(player.dir) * 2;
    
temp.hity player.1.5 vecy(player.dir) * 2;
    
test.lol showpoly(200, {
                          
temp.hitx 1.5temp.hity 1.5,
                          
temp.hitx 1.5temp.hity 1.5,
                          
temp.hitx 1.5temp.hity 1.5,
                          
temp.hitx 1.5temp.hity 1.5});
    
test.lol.mode 1;
    
test.lol.alpha .5;
    
triggerserver("gui"nametemp.hitxtemp.hity);
  }

Reply With Quote