View Single Post
  #9  
Old 05-31-2007, 01:33 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
if ( var = true )

could set var to true. There is a limited protection for this so whole scripts don't get screwed up.

I would recommend disabling the players weapons for this script, then custom scripting the onKeyPressed() instead of replacing the anis of sword, etc.

I personally would disagree with this:

PHP Code:
if (this.harpo_on == && keychar == "r") { 
I don't like that styling much, but it's purely personal preference. Most people think that so long as they are related that's okay. You could also do something like this:

PHP Code:
function onKeyPressedkeycodekeychar )
{
  if ( 
this.harpo_on == false )
  {
    return 
false;
  }
  if ( 
keychar == "r" )
  {
    if ( 
client.harpo_ammo != )
    {
      return 
false;
    }
    
    
// Set gani, change ammo, etc.
  
}

Also, I advise against using client.harpoon_ammo; you could use a this. variable, and then have it base encoded, and unencode it for checks. Something like this:

PHP Code:
function setAmmoammo )
{
  
this.ammo base64encodeammo );
}
function 
getAmmo()
{
  return 
base64decodethis.ammo );

This way it's harder to hack--though if it's a good hacker, they could just modify the code, hehe.

Nice script though; better than I used to do for guns.

(I used to modify sprites.png, and then change the arrows so they looked like bullets, then shoot arrows at everyone! Hah!)
__________________
Reply With Quote