View Single Post
  #8  
Old 05-19-2007, 05:35 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Gambet View Post
I would probably do so for better organization:
Why not this?
PHP Code:
function purchaseItem(temp.itemID

  switch (
temp.itemID
  { 
    case 
"Juggling"
    {
       if (
clientr.etcoins >= 30
       { 
         
player.clientr.etcoins -= 30
         
player.addweapon("*Prizes/Juggle"); 
       } 
         else 
       { 
         
player.chat "Insufficient funds!"
       } 

       break; 
     } 
  } 


function 
onPlayerChats() 

  
temp.tokens player.chat.tokenize(); 

  if (
temp.tokens[0] == "buy"
  {
    if (
temp.tokens[0in {"Juggling"})
    {
      
this.purchaseItem(player.chat.substring(4));
    }
  }

The clientside does not need to be involved, therefore there is no reason to involve it.
__________________
Skyld
Reply With Quote