Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-29-2007, 08:25 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Exclamation Gun Script

my gun can only attack like a sword, and i need to make it so it fires from afar, can someone help me?


__________________________________________________ ________
//#CLIENTSIDE
function onCreated() {
client.max_m16_ammo = 100;
client.m16_ammo= 100;
this.m16_on = 0;
}
function onWeaponFired() {
if (this.m16_on = 0) {
this.m16_on = 1;
if (this.m16_on == 1 && client.m16_ammo > 0) {
replaceani("walk", "nightmare_m16_walk");
replaceani("idle", "nightmare_m16_idle");
replaceani("sword", "nightmare_m16_fire");
} else if (this.m16_on == 1 && client.m16_ammo == 0) {
replaceani("walk", "nightmare_m16_walk");
replaceani("idle", "nightmare_m16_idle");
replaceani("sword", "nightmare_m16_reload");
}
} else if (this.m16_on == 1) {
this.m16_on = 0;
replaceani("walk", "walk");
replaceani("idle", "idle");
replaceani("sword", "sword");
}
}
function onKeyPressed(keycode, keychar) {
if (this.harpo_on == 1 && keychar == "r") {
if (client.harpo_ammo == 0) {
setani("nightmare_m16_reload", " ");
client.m16_ammo = client.max_m16_ammo;
}
}
if (keychar == "s" && client.m16_ammo > 0) {
client.m16_ammo -= 1;
setshootparams("damage", 10);
temp.shootangle = getangle(vecx(player.dir), vecy(player.dir));
shoot(player.x+vecx(player.dir), player.y+vecy(player.dir), player.z, temp.shootangle, 0, 0, "nightmare_m16_bullet", NULL);
}
}
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #2  
Old 08-04-2009, 08:55 PM
[email protected] jamerson61894@yahoo.com is offline
Banned
Join Date: Jul 2008
Posts: 83
jamerson61894@yahoo.com is an unknown quantity at this point
gs1 much?
Reply With Quote
  #3  
Old 08-04-2009, 08:58 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by [email protected] View Post
gs1 much?
It isn't, and old thread is old.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.

Last edited by Switch; 08-04-2009 at 09:32 PM.. Reason: old
Reply With Quote
  #4  
Old 08-04-2009, 09:29 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Edit: Ugh.. another old thread successfully answered two years too late. Thanks again trash talking jamerson.

I take it you're making a gun server, and you're going to want to disable pretty much all obvious classical systems, these are pretty much all the functions you should call.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
onCustomMode();
}

function 
onCustomMode() {
  
disablemap();
  
disablepause();
  
disableweapons();
  
disableselectweapons();  

You'll probably even need to use disable features using enablefeatures, there's plenty of other threads that show how to use that so just search.
__________________
Quote:
Reply With Quote
  #5  
Old 08-11-2009, 08:26 PM
Damien Damien is offline
Corpse
Join Date: Feb 2009
Location: 6 Feet under
Posts: 106
Damien is an unknown quantity at this point
Wooow. This is pretty useless. I made this 2 years ago when i tried making Final Resort. But if you manage to fix this script, you can use it on your servers.
Reply With Quote
Reply

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 03:06 PM.


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