View Single Post
  #8  
Old 04-11-2009, 07:51 AM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
Still doesnt trigger, Imma go post my script again, I modifyed a bit before.
I might should try easier stuff
NPC(Name: BlueFlag)
PHP Code:
function onActionDropFlag() { 
  echo (
"Flag got dropped");  //never comes :(
    
this.blueowner 2
    
this.dir 1
    
this.level ctf.gmap;
    
this.94.5;
    
this.26;  
    
this.blockagain();
    
this.show();
}
function 
onActionMoveFlag() { 
   if (
player.guild == "Red Team") {
    
player.addWeapon("-BlueFlag");
    
this.blueowner 1;
    
this.hide();
 }
}
function 
onCreated() { 
  
this.setshape(1,32,32); 
  
this.blueowner 2
  
this.dir 1
  
this.setcharani("sch_ctfblueidle",null); 
    
this.blockagain();
    
this.show();


//#CLIENTSIDE
function onPlayerTouchsme() {
triggeraction(this.xthis.y"moveFlag"player.account);


Weapon(Name: -BlueFlag)
PHP Code:
function onActionServerSide(cmd) { 
  switch (
cmd) { 
    case 
"removeWeapon": {
    
temp.pl findplayerbycommunityname(params[1]);
      
pl.removeWeapon("-BlueFlag");
      break; 
    } 
  } 


//#CLIENTSIDE
function onCreated() {
    
replaceani("walk""sch_ctfbwalk"); 
    
replaceani("idle""sch_ctfbidle"); 
  
showtext 0,player.x+1.5,player.y-1.5,arial,bc,Blue Flag!;
  
changeimgzoom 0,0.9;
  
client.bflag "got";
  
settimer(.05);
}

function 
onPlayerChats() { 
  if (
player.chat == "drop flag") {
   
triggerserver("npc""BlueFlag""DropFlag");   
    
replaceani("walk""walk"); 
    
replaceani("idle""idle"); 
    
setani("idle"null); 
    
triggerserver("gui"name"removeWeapon"player.account); 
  } 
}  

function 
onTimeout() {
if (
client.bflag == "got") {
  
showtext 0,player.x+1.5,player.y-1.5,arial,bc,Blue Flag!;
  
changeimgzoom 0,0.9;
    
settimer(.05);
 }

__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein

Last edited by Schetti; 04-11-2009 at 08:41 AM..
Reply With Quote