Here;s the BAN function:-
function Ban( plr, player, reason )
{
QuerySQL( sqliteDB, "INSERT INTO Bans(Name, IP, UID, Reason, Time, Admin) VALUES('" + plr.Name + "', '" + plr.IP + "', '" + plr.UniqueID + "', '" + reason + "', '" + GetFullTime() + "', '"+player+"')" );
EMessage( "Admin " + player + " has banned "+plr.Name+" from this server. Reason: " + reason + "." );
plr.Kick();
}
Don't worry about tables and etc, I have them. Now tell me can i use something like this:-
Ban(plr, "Server", "Hax0r");
Just tell this will work or not... If you found any error pl0x do tell me
Common sense is not common, you clearly see that in query you are taking the IP and the UniqueID of 'plr' instance, which won't work. Before that, you are taking 'plr.Name' which ends up like "Server".Name, will that work?
Atleast think over your implementation.
See the function name-
function Ban( plr, player, reason )
plr then player
So this one may work tho
Ban(player,"Server","hax0r")
OR this one
local plr = player, player = "server", reason = "Hax0r";
Ban(plr,player,reason)
Some more doubts:-
function onPlayerHealthChange( player, lastHP, newHP )
{
if ( newHP > 100 )
{
KickPlayer(player);
EMessage( ">>" + player.Name + " has been kicked from this server. Reason: HP Hack.");
}
local SP = AntiSP[ player.ID ];
if ( SP == true )
{
player.Health = 100;
}
}
2nd one:-
function onPlayerArmourChange( player, lastArmour, newArmour )
{
if ( player.newArmour >= 1)
{
if(stats[ player.ID ].Level < 6)
{
player.Kick();
EMessage(">> " + player.Name + " has been kicked. Reason: Armour Hack.");
}
}
}
3rd one:
function onPlayerWeaponChange( player, oldWep, newWep )
{
if ( player.newWep == 33 )
{
player.Disarm();
}
}
4th one:-
function onPlayerNameChange( player, oldName, newName )
{
return 1;
Message(">> " + oldName + " is now known as " + newName);
}
This one is from wiki, so it may work well.
I don't get what your last post has anything to do with it.
Why are you even asking stuff like this? Try it... It's not like your house will explode if it goes wrong.
But plz tell me about the Ban, I need it badly
Quote from: KAKAN on Sep 14, 2015, 06:15 PMBut plz tell me about the Ban, I need it badly
Seriously? What the heck did I just post there?
Regarding to that, this should work:-
Ban(player,"Server","hax0r")
If not, then tell me
Else, lemme try
Locked.