Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-19-2011, 11:52 AM
Starfire2001 Starfire2001 is offline
Unholy Nation
Starfire2001's Avatar
Join Date: Dec 2010
Location: The streets.
Posts: 156
Starfire2001 will become famous soon enough
Problems with onwall

The following script is part of a weapon, that when fired pushes any player in front of the player who fired the weapon a certain distance depending on how far away they are. Everything is working fine except for detecting a wall and stopping the player from going through it when they are hit. In this script I made it so my chat would say "onwall" if its detecting that the player is onwall and "good" if they are not, but regardless of where I fire the weapon wall present or not my chat always shows as "onwall", which leads me to believe I had no idea how to use onwall, but I haven't been able to find anything to help me with it. So yeah, as always, any help/advice would be greatly appreciated.

PHP Code:
function onActionServerSide(this.facethis.firexthis.firey){
  for (
temp.plplayers){
    if (
player.communityname != pl.communityname){
      
// Attack came from the bottom
      
if (face == 0){
        if(
pl.y in firey 2firey -.1 |) {
          if(
pl.x in firex 1firex |) {
            
pl.hearts 0;
          }
        }
        if(
pl.y in firey 3firey 2.1 |) {
          if(
pl.x in firex 1.5firex 1.5 |) {
            
temp.strength 12;
            for (
strength 12strength 0strength --){
              
sleep (.05);
              
pl.pl..5;
              if (
onwall(pl.x,pl.y-1.5)){
                
player.chat "onwall";
              }
              else{
                
player.chat "good";
              }
            }
          }
        }
      }
      if(
pl.y in firey 4firey 3.1 |) {
        if(
pl.x in firex 2firex |) {
          
temp.strength 8;
          for (
strength 8strength 0strength --){
            
sleep (.05);
            
pl.pl..5;
            if (
onwall(pl.x,pl.y-1.5)){
              
player.chat "onwall";
            }
            else{
              
player.chat "good";
            }
          }
        }
      }
      if(
pl.y in firey 5firey 4.1 |) {
        if(
pl.x in firex 2.5firex 2.5 |) {
          
temp.strength 4;
          for (
strength 4strength 0strength --){
            
sleep (.05);
            
pl.pl..5;
            if (
onwall(pl.x,pl.y-1.5)){
              
player.chat "onwall";
            }
            else{
              
player.chat "good";
            }
          }
        }
      }
    }
  }

Reply With Quote
 


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 +2. The time now is 07:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.