Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Gun Script (https://forums.graalonline.com/forums/showthread.php?t=75932)

Knightmare1 07-29-2007 08:25 PM

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);
}
}

[email protected] 08-04-2009 08:55 PM

gs1 much?

Switch 08-04-2009 08:58 PM

Quote:

Originally Posted by [email protected] (Post 1512942)
gs1 much?

It isn't, and old thread is old.

fowlplay4 08-04-2009 09:29 PM

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.

Damien 08-11-2009 08:26 PM

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.


All times are GMT +2. The time now is 04:35 PM.

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