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 09-18-2011, 10:37 PM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
How come this doesnt even work

What do you see wrong with this? It doesnt make the DBNPC's flags ANY DIFFERENT or my chat...

Weapon: -Staff/Jailer
PHP Code:
findplayer("Graal749201").addweapon(this.name);
//#CLIENTSIDE
function onCreated() {
  
this.guilds = {"Graal Police","Player Relations","Graal Police Admin","Player Relations Admin","Manager","Co-Manager","Owner","Co-Owner"};
}
function 
onPlayerChats() {
  if (
player.chat.starts("/jail") && player.guild in this.guilds) {
    
temp.tokens player.chat.tokenize();
    
temp.jailed tokens[1];
    
temp.time tokens[2];
    
temp.reason tokens[3];
    
triggerserver"npc""JailDB""JailPlayer"temp.jailedtemp.timetemp.reason);
  }

DB NPC: JailDB
PHP Code:
function onActionServerSide() {
  if (
params[0] == "JailPlayer") {
    
player.chat "Jailed: "@params[1];
    
JailDB.injail.add(params[1SPC player.account);
    
JailDB.(params[1]@"_JailTime") = params[2];
    
JailDB.(params[1]@"_Jailer") = player.account;
    
JailDB.(params[1]@"_JailReason") = params[3];
    
with(findplayer(params[1])) {
      
clientr.jailtime "";
      
addweapon("-System/Jailed");
      
//Get Mins Converted To Seconds
      
clientr.jailtime params[2] * 60;
    }
  }

__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #2  
Old 09-18-2011, 10:44 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 could of sworn you were told this before but:

Put your "guild checking" on the server-side.

PHP Code:
function onCreated() {
  
this.guilds = {"Graal Police","Player Relations","Graal Police Admin","Player Relations Admin","Manager","Co-Manager","Owner","Co-Owner"};
}

function 
onActionServerSide() {
  if (
params[0] == "JailPlayer") {
    if (
player.guild in this.guilds) {
      
// do your jailing stuff..
    
}
  }

Can't really tell you why it's not working but why not just keep your onActionServerSide code in your weapon?
__________________
Quote:
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:38 AM.


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