View Single Post
  #1  
Old 07-26-2016, 08:55 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
RC Russian Roulette

Cool RC game I made.

PHP Code:
// Add to your Control-NPC

function onRCChat() {
  if (
params[0in {"rr""russianroulette"}) {
    
rr_game();
    return;
  }
}

function 
rr_game() {
  if (
this.bullets == 0) {
    
this.bullets 6;
    
this.bullet int(random(0,6));
    
sendtorc("A new revolver has been loaded by " player.account ". /npc russianroulette to play.");
  } else {
    if (
player.account == this.lastshot) {
      
sendtorc("Wait for someone else to pull the trigger " player.account ".");
      return;
    } else {
      
this.lastshot player.account;
    }
    
this.bullets--;
    if (
this.bullets == this.bullet) {
      
sendtorc(format("/disconnect %s \"bang\""player.account));
      
this.bullets 0;
    } else {
      
sendtorc("Click! You are safe " player.account);
    }
    if (
this.bullets == 1) {
      
this.bullets 6;
      
this.bullet int(random(0,6));
      
sendtorc("The revolver cylinder has been spun.");
    }
  }

__________________
Quote:
Reply With Quote