View Single Post
  #8  
Old 12-19-2011, 08:58 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Trakan View Post
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?
You can simply add something like (not safe):

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  if (
clientr.ammo && this.shootedtimes 5) {
    
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");
    
this.shootedtimes ++; //increase the times the player fired the weapon
    
freezeplayer(0.75);
  }
  else {
    
player.chat "No Ammo!";
    
this.shootedtimes 0//no ammo or player fired the weapon 5 times? Well than the counter goes back to 0
    
setani("reload"NULL);
  }

or safe (just an example)

PHP Code:
function onActionServerSide() {
  if (
params[0] == "shootplus") {
    if (
clientr.firedtimes 5) { //just an additional check (needed?)
      
clientr.firedtimes ++; //increase the times the player fired the weapon by 1
      
clientr.ammo --; //decrease the ammo by 1
    
}
  }
  if (
params[0] == "shootminus") {
    
clientr.firedtimes 0//reset the shooting times
  
}
}

//#CLIENTSIDE
function onWeaponFired() {
  if (
clientr.ammo && clientr.firedtimes 5) {
    
player.chat "PENG!";
    
triggerserver("weapon"this.name"shootplus");
    
freezeplayer(0.75);
  }
  else {
    
player.chat "No peng :( let´s reload";
    
triggerserver("weapon"this.name"shootminus");
  }


Just something quick bumped
__________________
MEEP!
Reply With Quote