View Single Post
  #7  
Old 12-19-2011, 06:40 PM
Trakan Trakan is offline
It's all about cats!
Trakan's Avatar
Join Date: Sep 2010
Location: France
Posts: 64
Trakan is an unknown quantity at this point
Quote:
Originally Posted by Gunderak View Post
I have tried to fix up you're script.
Try this out.
PHP Code:
function onActionServerSide() {
  if (
params[0] == "deductammo") {
    
clientr.ammo -= 1;
  }
  if (
params[0] == "add") {
    
clientr.ammo 10;
    
player.attr[15] = "holst_usp45.png";
  }
}

function 
onActionProjectile() {
  
player.hearts -= 6;
}
//#CLIENTSIDE 

function onPlayerChats() {
  if (
player.chat == "/ammo") {
    
triggerserver("weapon"this.name"add");
    
replaceani("walk""holst_gunwalk");
    
replaceani("idle""holst_gunidle");
    
player.chat == "Ammo Added!";
  }
}

function 
onWeaponFired() {
  if (
clientr.ammo 0) {
    
shoot(player.vecx(player.dir), player.vecy(player.dir), player.z, (playerdir 1) * pi 2NULLNULL"holst_bullet"NULL);
    
setani("holst_gunfire"NULL);
    
triggerserver("weapon"this.name"deductammo");
    
freezeplayer(0.75);
  } else {
    
player.chat "No Ammo!";
  }
}

function 
onKeyPressed(codekey) {
  if (
key == "e") {
    
setani("holst_gunreload"NULL);
    
triggerserver("weapon"this.name"reload");
  }

Also why was there capacityammo, maxcapacityammo and ammo.
You only really need two..
clip and ammo, but for this script you only need ammo.
This work thanks .
I would put a limit-Standing for the charger. When the player shoots 5 balls, it must charge to fulfill its charger.
How can I do it?
Reply With Quote