View Single Post
  #4  
Old 10-07-2006, 04:49 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
0.05 timeout serverside....ouchies

Heres a timeout-less method if you do wish to keep the whole script serverside.

PHP Code:
function onCreated()
{
  
this.allowed = {"Twinny","your account here"};
  
setimg("block.png");
  
update();
}

function 
onPlayerChats()
{
  if (
player.chat.starts("/donate"))
  {
    
temp.money int(player.chat.substring(8,-1));
    if (
temp.money > -1)
    {
      if (
player.rupees => temp.money)
      {
        
server.donation += temp.money;
        
player.rupees -= temp.money;
        
update();
      }
      else 
player.chat "Not Enough Money";
    }
    else 
player.chat "Perhaps an actual amount?";
  }
  
  else if (
player.chat == "/take donation")
  {
    if (
player.account in this.allowed)
    {
      
player.rupees += server.donation;
      
server.donation NULL;
      
update();
    }
    else 
player.chat "Who are you?";
  }
}

function 
update()
  
showtext(1this.1this..5"Arial""bc",
           
"Current Donation:" SPC server.donation); 

Last edited by Twinny; 10-07-2006 at 05:00 PM..
Reply With Quote