View Single Post
  #20  
Old 08-26-2009, 10:27 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
Well I'd have a DBNPC for this called SparBot, or something.

It would hold all the data, spar locations, matches, etc. You wouldn't need to use serverr flags at all.

In a DB-NPC you could have:

DB NPC Name: SlaveBot

PHP Code:
public function onWarpPlayer(acct) {
  
findplayer(acct).setlevel2("onlinestartlocal.nw"3030);

Then in a weapon npc.

PHP Code:
function onActionServerSide() {
  switch (
params[0]) {
    case 
"kick":
      
findnpc("SlaveBot").onWarpPlayer(params[1]);
      
player.chat "Kicked" SPC params[1]; 
      break;
  }
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/kick")) {
    
triggerserver("gui"name"kick"player.chat.substring("/kick ".length()));
  }

This is just an example of interacting with a DB NPC.

On the serverside you can do things in NPCs like:

PHP Code:
function onCreated() {
  
setTimer(1);
}

function 
onTimeout() {
  for (
temp.aallplayerstemp.a.chat "You are being watched by " this.name;
  
setTimer(10);

Will let everyone know they're being watched every 10 seconds Of course that's just an example.
__________________
Quote:
Reply With Quote