Thread: Robbing; help
View Single Post
  #1  
Old 01-13-2009, 07:02 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
Robbing; help

So I have this script, I know its not the most effecient, but I am still learning. I am having trouble using the triggeractions, obviously, and also getting it to only effect the player who grabbed the safe.

I have this in the class:
PHP Code:
function onActionServerside() {
  
player.guild "Robbing!";
  
playerrupees += 1000;
}
//#CLIENTSIDE
function onCreated()
{
  for (
pl:allplayers) {
    if (
player.guild "test") {
      
player.chat "Alert:" SPC player.account SPC "is robbing the safe at" SPC player.level;
  }
}
  
robbing false;
  
setTimer(0.05);
  new 
GuiProgressCtrl("Rob_Progress") {
    
profile GuiBlueProgressProfile;
    
0;
    
0;
    
width 160;
    
height 20;
    
progress 0;
    
visible false;
  }
  new 
GuiButtonCtrl("Cancel_Button") {
    
profile GuiBlueButtonProfile;
    
170;
    
0;
    
width 50;
    
height 20;
    
text "Abort";
    
visible false;
  }
}
if (
robbing false) {
  function 
onTimeout() {
    
Rob_Progress.visible true;
    
Cancel_Button.visible true;
    
setTimer(0.05);
    
disabledefmovement;
    
robbing true;
    
Rob_Progress.progress += 0.01;
    
timeout=0.05;
    
//player.chat = Rob_Progress.progress;
    
setTimer(0.05);
      if (
Rob_Progress.progress 1) {
        
setTimer(0);
        
enabledefmovement;
        
Rob_Progress.visible false;
        
Cancel_Button.visible false;
        
player.chat "Sucessfully robbed the safe!";
        
//triggeraction(0,0,"serverside",onTimeout);
    
}
  }
}
function 
Cancel_Button.onAction() {
  if (
robbing true) {
    
robbing false;
    
enabledefmovement;
    
setTimer(0);
    
player.chat "Aborted robbery!";
    
sleep(1);
    
Rob_Progress.visible false;
    
Cancel_Button.visible false;
  }


Last edited by pig132; 01-13-2009 at 08:00 AM..
Reply With Quote