Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-10-2007, 03:24 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
PHP Code:
function onActionServerSide() {
  
with (findplayer(params[0])) {
    
clientr.mud_nation "Neutral";
  }
}
//#CLIENTSIDE
function onPlayerEnters() {
  if (
clientr.mud_nation == NULL) {
    
triggerserver("gui",this.name,player.account);
  }

Add this into your main-system. This, when you log on, check if you "clientr.mud_nation" is null (has nothing in it). If it comes out true, then it triggers the server-side which will turn your "clientr.mud_nation" to "Neutral". If it comes false, you go about normally.
If that doesn't work then I think it's because of "function onPlayerEnters()" but I believe it should work.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #2  
Old 10-10-2007, 07:32 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Switch View Post
PHP Code:
function onActionServerSide() {
  
with (findplayer(params[0])) {
    
clientr.mud_nation "Neutral";
  }
}
//#CLIENTSIDE
function onPlayerEnters() {
  if (
clientr.mud_nation == NULL) {
    
triggerserver("gui",this.name,player.account);
  }

Although your method works perfectly fine, that way isn't the best way to go about doing this.

There are a few problems I see right off the bat:
1) For this sort of situation, it is better to use the Control-NPC.
2) That way you have it set up isn't totally secure. (People could potentially reset the nation of other players). You do not need to pass player.account and have it find the player again serverside.
3) You only have to check for the condition when the weapon is created, and not every time a player enters a level.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.