Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Get a message (https://forums.graalonline.com/forums/showthread.php?t=134261718)

Twaina 01-17-2011 04:12 AM

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

cbk1994 01-17-2011 04:32 AM

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.

Twaina 01-17-2011 04:37 AM

lol understanding wait

cbk1994 01-17-2011 04:42 AM

Quote:

Originally Posted by Twaina (Post 1623380)
lol understanding wait

what

fowlplay4 01-17-2011 06:49 AM

Quote:

Originally Posted by cbk1994 (Post 1623382)
what

We can't help them. :(


All times are GMT +2. The time now is 12:43 AM.

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