View Single Post
  #2  
Old 04-05-2009, 03:55 PM
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
You're mixing GS1 and GS2, which is a very bad thing.

Here's your weapon. Basically just doing the same thing, but with some GS2 corrections/styling.

PHP Code:
function onActionServerSide(cmd) {
  switch (
cmd) {
    case 
"removeWeapon": {
      
player.removeWeapon("-System/Ctfblue"); // Is this seriously the name of the weapon?
      
break;
    }
  }
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "drop flag") {
    
replaceani("walk""walk");
    
replaceani("idle""idle");
    
setani("idle"null);
    
triggerserver("gui"name"removeWeapon");
  }

And assuming the flag needs to move, best thing to do would be to create a DB NPC for the flag, then add something like this in the "removeWeapon" case in your weapon

PHP Code:
BlueFlag.trigger("dropFlag"player); 
then in the DB NPC do something like this

PHP Code:
function onCreated() {
  
this.setshape(1,32,32);
  
this.blueowner 2;
  
this.dir 1;
  
this.setcharani("sch_ctfblueidle",null);
}
function 
onActionDropFlag(pl) {
  if (
pl.client.blueowner == 1) {
    
this.blueowner 2;
    
this.dir 1;
    
pl.client.blueowner 2;
    
this.show();
  }

__________________
Reply With Quote