1.
Can someone Please give me the console script, used in most private mods, that when you say something in chat it does a command?
Example :
Player says "GetStats"
Console runs command RetrieveStats(Playername); and displays the player's BL_ID, name, score, ETC.
Player says "Omg"
Console makes chat message "wtfbbq."
Player says (number)+(number2)
Console returns, in chat, the sum of the values.
2.
I'm trying to make a database system for one of my mods i'm messing around with,
and it has an error in the storage command.
I think it might be that i'm trying to nest a variable in another variable for the name.
Like so:
Function databaseAdd(%variable,%value) {$(%variable) += %value;}
The error is in the $(%variable).
Pls help!
Ninjedit :
Okay, i need one more thing.
I want to restrict rights to using the command...
It needs to:
Be able to set three levels of access: Read|ReadWrite|EditaccessReadWrite
EditaccessReadWrite must be able to change access level of all other players, and edit the database
ReadWrite must be able to edit the database but not access levels
Read must not be able to edit the database or access levels
So basically, i need variables.
Also, how do i include a text variable in the first command
package chatstuff
{
function serverCmdMessageSent(%client,%message)
{
Parent::serverCmdMessageSent(%client,%message);
if(%message $= "omg")
messageAll('','wtfbbq');
}
};
ActivatePackage(chatstuff);
What if i wanted to have a blank spot in there, where it would allow a numeral?
(Copied from bottom, since nobody will probably scroll all the way down there.)
NINJEDIT II:
Okay, i have teh answers to all that.
1. How do i do the access-code script, told about below by Headcrab Zombie?
2. What's wrong with this script?
Shown like Console, ## on side of error stop.
No matter what i enter in between the "", it always thinks the first " is not supposed to be there.
If i remove the "", it errors the first character.
//Comments not in actual code.
//ATTEMPT 1
if(getSubStr(%message,0,2) $= ##"##CB");
//ATTEMPT 2
if(getSubStr(%message,0,2) $= ##"##*");
//ATTEMPT 3
if(getSubStr(%message,0,2) $= ##C##B);
//ATTEMPT 4
if(getSubStr(%message,0,2) $= ##X##); //I knew in this one that a * would completely break it.\
Fixed dis.