I'm still learning to script, so I was like hey let's make a tag for event's team, but guild won't set
HTML Code://#CLIENTSIDE
function OnPlayerChats () {
if (player.chat == "/et"){
set.guild="Events Team";
}
}
Printable View
I'm still learning to script, so I was like hey let's make a tag for event's team, but guild won't set
HTML Code://#CLIENTSIDE
function OnPlayerChats () {
if (player.chat == "/et"){
set.guild="Events Team";
}
}
PHP Code:
#//CLIENTSIDE
function onPlayerChats() {
if (player.chat =="/et") {
player.guild = "Events Team";
}
}
I wonder why there needs to be spaces?
you put extra spaces in the script
if (player.chat =="/et") {
player.guild = "Events Team";
Makes it easier to read. It's called styling.
Doesn't work
where do you even put this PHP code at? to set the tag
I would just put a npc and do
Function onplayerchats(){
If (player.chat == "/et");
If (player.ap == "100");
Player.guild = "Events Team"
}
There is no serverside verification before it sets the tag.
That is probably a bit above your skill level at the moment, but I'm gonna go ahead and recommend you read up on it. If you need some examples I'd be happy to help.
I am not too good at coding, but I'll give it a try:
//#CLIENTSIDE
function onCreated () {
if (clientr.staff == 1 && player.chat == /et)
player.guild = Events Team
player.setlevel2 ("Event Level Name Here.nw");
}else{
player.chat == "I'm not a staff member!"
}
}
You're missing curly brackets, quotations, semi colons and styling. You have the incorrect function as it should be onPlayerChats().
This also requires the staff member to have clientr.isStaff in their player attributes flags.PHP Code:
//#CLIENTSIDE
function onPlayerChats(){
if (clientr.isStaff){
if (player.chat == "/et"){
player.guild = "Events Team";
player.ap += 100;
}
}
}
Oh - I didn't test this - I'm about to test it now.
Won't set guild.
Using any of these snippets in a weapon (created from rc) will not work because they're clientside. Either put it in a level or use serverside
You would want to just do,
because when you are using += it just adds 100 on to the players ap.PHP Code:
player.ap = 100;
Lets say you have your ap at 30 and you use += it will make it 130, try
to see what I mean it should come out as 130 or some ridiculously high number.PHP Code:
echo(player.ap);
Logic and syntax wise, this is correct. (except player.ap should be equals to 100, not add 100 to it)
But sadly, player.guild can only be edited on the serverside for protection purposes. (let's say, from hackers)
The way to achieve this would be:
I don't remember if I have explained this in my tutorials, but if I did, I think it would explain on how client and server interactions work. Might want to check it out.PHP Code:
function onActionServerSide() {
player.guild = "Events Team";
player.ap = 100;
}
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat == "/et") {
triggerserver("weapon", this.name, "");
}
}
1. As far as I know, there is none, though it will organize the triggeractions happening, so if the weapon is a GUI, there is no shame in sending a triggerserver as a gui, if it isn't, just use weapon.
2. Actually, "" will be equals to params[0] (the first parameter of the function onActionServerSide()), it is sending a variable, yet this variable is empty. In theory, you shouldn't send NULL even though that wouldn't matter, but it can work.
NULL on Graal is really badly represented, NULL is equals to 0 as well as "" which is a really bad interpretation of its use.
Thanks John!
Since your inbox is full, I'll ask it here. What is the use for switch and case in the function onActionServerSide() { ?