Okay so I want to eventually have stronger ban methods than just a IP ban,.
Does XML scripting in the style of [LU] exist? Would be interesting to script in a replica of the banlist.xml from [LU]
For now I am only using a real basic setting for ban types until I configure how I really want to actually do it,.
So If anyone has any Ideas and or methods please be kind and share., I prefer to not use SQ_Lite methods,..
This method can be bypassed as we all know...
if (cmd == "ban") {
if ((Level < AdminFlagTypes.Ban)) {
MessagePlayer( "Invalid command! Type /cmds", player);
return true;
}
if (!text) {
MessagePlayer( "Ban player: /ban [id]", player);
return true;
}
local id = FindPlayer(text.tointeger());
if (!id) {
MessagePlayer( "Player is not connected", player);
return true;
}
Message( "Admin " + player.Name + " has banned " + id.Name, );
BanPlayer(id);
return true;
}
no way to do in XML, but a way to do in JSON is there. However, the JSON plugin is outdated :(
Though, XML will be implemented, but later.
So WriteIni can supposedly corrupt data? I think this would be the last clean resort, also would be nice to add in, I can make subnet bans without Sq_Lite as well. so any other method than Sq_Lite bans would be nice. If I can not figure out a correct way hear, I will just configure something..
Quote from: Mötley on May 07, 2016, 03:57 PMOkay so I want to eventually have stronger ban methods than just a IP ban,.
Does XML scripting in the style of [LU] exist? Would be interesting to script in a replica of the banlist.xml from [LU]
For now I am only using a real basic setting for ban types until I configure how I really want to actually do it,.
So If anyone has any Ideas and or methods please be kind and share., I prefer to not use SQ_Lite methods,..
This method can be bypassed as we all know...
if (cmd == "ban") {
if ((Level < AdminFlagTypes.Ban)) {
MessagePlayer( "Invalid command! Type /cmds", player);
return true;
}
if (!text) {
MessagePlayer( "Ban player: /ban [id]", player);
return true;
}
local id = FindPlayer(text.tointeger());
if (!id) {
MessagePlayer( "Player is not connected", player);
return true;
}
Message( "Admin " + player.Name + " has banned " + id.Name, );
BanPlayer(id);
return true;
}
How can it be bypassed i would prefer sqlite byt how would it be byapassed how can player byapass a UID ban???????
That is a IP ban. I wish it were UID
Quote from: Coolkid on May 07, 2016, 09:27 PMQuote from: Mötley on May 07, 2016, 03:57 PMOkay so I want to eventually have stronger ban methods than just a IP ban,.
Does XML scripting in the style of [LU] exist? Would be interesting to script in a replica of the banlist.xml from [LU]
For now I am only using a real basic setting for ban types until I configure how I really want to actually do it,.
So If anyone has any Ideas and or methods please be kind and share., I prefer to not use SQ_Lite methods,..
This method can be bypassed as we all know...
if (cmd == "ban") {
if ((Level < AdminFlagTypes.Ban)) {
MessagePlayer( "Invalid command! Type /cmds", player);
return true;
}
if (!text) {
MessagePlayer( "Ban player: /ban [id]", player);
return true;
}
local id = FindPlayer(text.tointeger());
if (!id) {
MessagePlayer( "Player is not connected", player);
return true;
}
Message( "Admin " + player.Name + " has banned " + id.Name, );
BanPlayer(id);
return true;
}
How can it be bypassed i would prefer sqlite byt how would it be byapassed how can player byapass a UID ban???????
Just hook something and you can change the UID to anything you want.
I don't really get what you mean, but, this might help you.
Subban system (http://forum.vc-mp.org/?topic=346.0) || UID ban system. (http://forum.vc-mp.org/?topic=200.0)
I would prefer to just ban the uid normally,. As a project I am working on I need to keep anything Sq_Lite related out (hashes)
I can create a ban system with hashes, I can even create subnet bans with hashes. I want to know of any other possible ways of ban methods, I have tried BanPlayer(id.UniqueID);
but of course errors.
Any Idea's? maybe Stormeus? anything else I could do to the banlist file before I do anything else first?
ah well,
@Stormeus I was trying this code:
foreach( idx, value in CPlayer )
print( idx + " : " + value );
Well, it didn't show UID or UID2 or UniqueID in the function list :(
@KAKAN It's not a function. It's a property hidden in the _get metamethod.
Because UID, UID2 is a property. And properties are in two get/set tables that are retrieved by the _get/_set meta-methods whenever the requested index does not exist.
foreach (idx, val in CPlayer.__getTable) print(idx + " : " + value);
foreach (idx, val in CPlayer.__setTable) print(idx + " : " + value);
http://forum.vc-mp.org/?topic=2085.msg15450#msg15450
Quote from: Stormeus on May 08, 2016, 04:06 AM@KAKAN It's not a function. It's a property hidden in the _get metamethod.
I was thinking of that. I got another question, can we have some private variables inside a class in Squirrel?
:edit: Oops, my fault, this one is working:
foreach( idx, value in CPlayer.__getTable )
print( idx + " : " + value );
Quote from: KAKAN on May 08, 2016, 04:09 AMI got another question, can we have some private variables inside a class in Squirrel?
Squirrel has no concept of encapsulation. Maybe, just maybe, you can fool the language using the _get/_set meta-methods to stop direct access. However, that encapsulation can be broken with indirect methods of access.
So... lol I take it BanPlayer(id.UniqueID);
would never work in any way?
the error is
parameter 1 has an invalid type string expected instance
man.
BanPlayer is a inbuilt function, which needs to have a player instance.
Use your custom ban function instead.
function Ban( uid )
{
//Open the INI file
//Write the info
//Done
}
Quote from: . on May 08, 2016, 04:12 AMQuote from: KAKAN on May 08, 2016, 04:09 AMI got another question, can we have some private variables inside a class in Squirrel?
Squirrel has no concept of encapsulation. Maybe, just maybe, you can fool the language using the _get/_set meta-methods to stop direct access. However, that encapsulation can be broken with indirect methods of access.
got it, thanks
Well I tried everything. I attempted to add to the original file the uid with hashes, Worked. Would not kick the player. but with IP's yes. So sadly wasted my time.
To sadI did not know that UID's were not supported in the banlist file if so i would of not tried,. : :( stinks
I just did not want to use my own features as I want to keep everything at default as much as possible.
So I will possibly use ini until xml scripting is supported..