View Single Post
  #1  
Old 12-19-2011, 05:59 AM
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
'No ammo' Problem !

Okay, hello everyone. I work on a gun script for my server but the problem is with the ammunitions
It say "No ammo" !
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
if (
player.chat "/ammo"){
  
clientr.ammo += 10;
  
clientr.capacityammo 5;
  
clientr.maxcapacityammmo 5;
  
setplayerprop #P2,holst_usp45.png;
  
replaceani walk,holst_gunwalk;
  
replaceani idle,holst_gunidle;
  
setplayerprop #c,Ammo added;
}
}
function 
onWeaponFired() {
  if (
clientr.ammo && clientr.capacityammo != 0) {
  
shoot(player.vecx(player.dir), player.vecy(player.dir), player.z, (playerdir 1) * pi 2NULLNULL"holst_bullet"NULL);
  
setani("holst_gunfire"NULL);
  
clientr.ammo -= 1;
  
clientr.capacityammo -= 5;
  
freezeplayer(0.75);
} else {
setplayerprop #c,No ammo!;
}
}
function 
onActionProjectile() {
  
player.hearts -= 6;
}
//#CLIENTSIDE
function onKeyPressedcodekey )
{
  if ( 
key == "e" || key == "E" )
  {
setani("holst_gunreload"NULL);

Reply With Quote