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.