View Single Post
  #6  
Old 09-25-2011, 07:24 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I imagine this is what you're going for, I've re-factored your code below. You could create a class called:

events_commands

PHP Code:
function onCreated() {
  
// Gives your NPC shape on the server-side so 
  // triggeraction has something to hit.
  
this.setshape(13232);
}

function 
onActionKickPlayer() {
  
// Make sure the 'kicker' is on the Events Team
  
if (player.guild == "Events Team") {
    
// Get account from first parameter
    
temp.acc params[0];
    
// Kick account
    
kickPlayer(temp.acc); 
  }
}

function 
kickPlayer(acc) {
  
// Find Player
  
with (findplayer(acc)) {
    
// Kick/Relocate Player
    
player.30
    
player.30;
  }
}

//#CLIENTSIDE

function onPlayerChats() { 
  if (
player.chat == "/kick") { 
    for (
temp.plplayers) { 
      if (
mousex in temp.pl.xtemp.pl.| && mousey in temp.pl.ytemp.pl.| ) {
        
// To trigger level npcs you have to use triggeraction like this:
        // It will trigger onActionKickPlayer
        
triggeraction(this.1this.1"KickPlayer"temp.pl.account);
      } 
    } 
  } 

and place that in your event levels like this:

PHP Code:
function onCreated() {
  
join("event_commands");

__________________
Quote:
Reply With Quote