Author Topic: Problem with a rules script  (Read 835 times)

Idk i just started doing scripts today i have a couple that something to the whole server but im trying one for just clients and now it doesnt seem to work. What can i add to this to make it work
Code: [Select]
function serverCmdRules(%client)
{
messageclient("","\c1 1. Dont spam");
messageclient("","\c1 2. Dont ask for admin");
messageclient("","\c1 3. Dont ask to load");
messageclient("","\c0 Break a rule and you will be kicked or banned");
}

You're not giving a client to send the message to.

Ahh didnt know how would i go about doing this. Like I said I started scripting today

Code: [Select]
function serverCmdRules(%client)
{
messageclient(%client,'','\c1 1. Dont spam');
messageclient(%client,'','\c1 2. Dont ask for admin');
messageclient(%client,'','\c1 3. Dont ask to load');
messageclient(%client,'','\c0 Break a rule and you will be kicked or banned');
}
Fixed. Also, Use ' instead of ", unless you want the client to actually be messaged \c1, instead of whatever color (I forget) it would change it to.

Hey thanks. Just good to know what to do now. Hmmm now i need to learn how to script useful stuff.

I'm stumped it still doesnt work. I added the %client, but it still doesnt work. I'm puting in /rules and all my other scripts worked as so, so why not know. Well any way this is what i now have.
Code: [Select]
function servercmdrules(%client)
{
messageclient(%client,",'\c1 1. Dont spam");
messageclient(%client,",'\c1 2. Dont ask for admin");
messageclient(%client,",'\c1 3. Dont ask to load");
messageclient(%client,",'\c0 Break a rule and you will be kicked or banned");
}


Quote from: code
function servercmdrules(%client)
{
   messageclient(%client,",'\c1 1. Dont spam");
   messageclient(%client,",'\c1 2. Dont ask for admin");
   messageclient(%client,",'\c1 3. Dont ask to load");
   messageclient(%client,",'\c0 Break a rule and you will be kicked or banned");
}
You didn't change all of the quotation marks.

Thanks randy and headcrab zombie. Now i feel kinda dumb.

I'm about ready to give up. The script is exactly how you guys told me to put it as, and this is a very simple script.
Code: [Select]
function serverCmdRules(%client)
{
messageclient(%client,'','\c1 1. Dont spam');
messageclient(%client,'','\c1 2. Dont ask for admin');
messageclient(%client,'','\c1 3. Dont ask to load');
messageclient(%client,'','\c0 Break a rule and you will be kicked or banned');
}

Are you sure you've enabled it?

yep then i typed /rules and nothing :/

Ok mabye it's were i put the script. Would you happen to know were i would. Its curretly in the add-ons folder.

Copy and pasted it directly from your post, into a new file in my add-ons directory, enabled it, and it worked just fine. Don't know what the problem is.