Thread: Mining stuff
View Single Post
  #1  
Old 06-30-2006, 10:48 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Mining stuff

Working on a mine script, it soesn't work with the parameter check in it, and it doesn't work without it either. It does part of the script, but seems to randomly stop before freezeplayer? Weird.
PHP Code:
function onActionserverside()
{
  if(
params[0]=="mine")
  {
    if(
clientr.minerocks>0)
    {
      
//variable setup
      
this.mine int(random(0,101));
      
this.time random(3,8);
      
player.dif=2;
      
freezeplayer(this.time);
      
player.chat "Searching through pile";
      
showimg(4,"dr-minerocks.png",playerx+.5,playery+2.1);
      
changeimgvis(4,.5);
      
changeimgzoom(4,.75);
      
setani("push",NULL);
      
sleep(this.time);
      
hideimg(4);
      if(
this.mine<=15)
      {
        
//15%
        
player.chat "Found some Carbon!";
        
addweapon("Tools/Carbon");
        
clientr.carbon++;
        
clientr.minerocks--;
      }
      else if(
this.mine<=25)
      {
        
//10%
        
player.chat "Found some Iron!";
        
addweapon("Tools/Iron");
        
clientr.iron++;
        
clientr.minerocks--;
      }
      else if(
this.mine<=30)
      {
        
//5%
        
player.chat "Found some Silver!";
        
addweapon("Tools/Silver");
        
clientr.sliver++;
        
clientr.minerocks--;
      }
      else if(
this.mine<=35)
      {
        
//5%
        
player.chat "Found a Saphire!";
        
addweapon("Tools/Saphire");
        
clientr.saphire++;
        
clientr.minerocks--;
      }
      else if(
this.mine<=40)
      {
        
//5%
        
player.chat "Found a Ruby!";
        
addweapon("Tools/Ruby");
        
clientr.ruby++;
        
clientr.minerocks--;
      }
      else if(
this.mine<=43)
      {
        
//3%
        
player.chat "Found Gold!!";
        
addweapon("Tools/Gold");
        
clientr.Gold++;
        
clientr.minerocks--;
      }
      else
      {
        
player.chat=="Nothing";
        
clientr.minerocks--;
      }
    }
    else
    {
      
player.chat="You have no more mine rocks!";
    }
  }
}
      
          
//#CLIENTSIDE
function onWeaponfired()
{
  
triggeraction(0,0,"serverside","New mining","mine");

Reply With Quote