Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-17-2011, 12:27 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Concept Of A Rocket Launcher

Here is just a base of what iv made, any suggestions are welcome.
Also if you know how to make the rotation correct by where the mouse is it would be appriciated.
i havnt done any gfx for it yet as i suck at gfx.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.rocketfired 0;
  
onTimeout();
}

function 
onWeaponfired() {
  if (
this.rocketfired == "1") {
    
this.rx mousex;
    
this.ry mousey;
    
onTimeout();
  }
  
this.rocketfired 1;
}

function 
onTimeout() {
  if (
this.rx mousex) {
    
this.rx++;
  }
  if (
this.ry mousey) {
    
this.ry++;
  }
  if (
this.rx mousex) {
    
this.rx--;
  }
  if (
this.ry mousey) {
    
this.ry--;
  }
  if (
this.rocketfired == "1") {
    
showimg(1"block.png"this.rxthis.ry);
    
player.chat "Rocket Moving!";
  }
  if (
onwall(this.rxthis.ry)) {
    
onExplodeRocket();
  }
  for (
temp.plplayers) {
    if (
this.rx in pl.xpl.2.5 | && this.ry in pl.ypl.| ) {
      
onExplodeRocket();
    }
  }
  
settimer(0.05);
}

function 
onExplodeRocket() {
  if (
this.rocketfired == "1") {
    
putexplosion(1this.rxthis.ry);
    
player.chat "Rocket Exploded!";
    
this.rocketfired 0;
    
hideimg(1);
  }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 +2. The time now is 12:41 PM.


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