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 01-17-2011, 04:12 AM
Twaina Twaina is offline
Registered User
Join Date: Dec 2010
Posts: 59
Twaina has a little shameless behaviour in the past
Red face Get a message

So I made a script that works but I need to change something and do not come on please help me;! (

Quote:
PHP Code:
function onPlayerChats()
  {
  if (
player.chat != "/prhelp");
  if (
hasweapon(PrHelp)){
    
say2("You send a message!");
    {
      return;
    }
    
sendtorc("People need PR help!");
      if (
hasweapon(PrTag)){

        
say2("People need PR help!");
      }
    }
  } 
Just as I do that so if the players chat / prhelp
The ones with the Weapon PrTag get a say2 message where stand as a Text"People need help!"
Please help : (Thanks
Reply With Quote
  #2  
Old 01-17-2011, 04:32 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
PHP Code:
function onPlayerChats() { 
  if (
player.chat != "/prhelp") {
    return; 
// use return here to end the function, before you ended the if statement with a semicolon which doesn't work
  
}
  
  
say2("You sent a message!");
  
  
// tell RC that someone needs help
  
sendToRC("Someone needs PR help!");
  
  
// loop through every player online
  
for (temp.pl allplayers) {
    if (
pl.hasWeapon("PrTag")) { // I think this works?
      
pl.say2("Someone needs PR help!");
    }
  }

This would work in a level NPC. If it's meant to be used in a weapon you will have to use onPlayerChats on clientside, trigger serverside, then use sendToRC and loop through the players on serverside.

I'm not quite sure what the weapon "PrHelp" is supposed to be. Does the player need it to use the help? If so, you should probably just do what I advised above and put the script in the weapon.

Let me know if you don't understand anything I said.
__________________
Reply With Quote
  #3  
Old 01-17-2011, 04:37 AM
Twaina Twaina is offline
Registered User
Join Date: Dec 2010
Posts: 59
Twaina has a little shameless behaviour in the past
lol understanding wait
Reply With Quote
  #4  
Old 01-17-2011, 04:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Twaina View Post
lol understanding wait
what
__________________
Reply With Quote
  #5  
Old 01-17-2011, 06:49 AM
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
Quote:
Originally Posted by cbk1994 View Post
what
We can't help them.
__________________
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 03:35 AM.


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