Evaluation System

Started by Finch, Apr 01, 2015, 09:15 AM

Previous topic - Next topic

Finch

Hi and Hello Guyz I am Back to VCMP i was gone for some work And i am back with usefull snipets
Evaluation system is like if u make any admin in your server then use /addadmin full name then admin name will add it will show that admin has how much kicks and bans you have to type /einfo admin full name if exist then its will show
admin name:
kicks:
bans:
 then it will be easy for owner to promote admin or demote

Commands

/einfo, /addadmin, /removeadmin.

Just Add this on Functions.nut


function SetBan( player, amount )
{
QuerySQL(db, "UPDATE Evaluation SET Ban='" + amount.tointeger() + "' WHERE Name='" + player.Name + "'");
}
function GetBan( player )
{
local Ban = GetSQLColumnData( QuerySQL( db, "SELECT Ban FROM Evaluation WHERE Name='" + player.Name+"'" ), 0 );
if ( Ban ) return Ban;
else return 0;
}
function SetKick( player, amount )
{
QuerySQL(db, "UPDATE Evaluation SET Kick='" + amount.tointeger() + "' WHERE Name='" + player.Name + "'");
}
function GetKick( player )
{
local Kick = GetSQLColumnData( QuerySQL( db, "SELECT Kick FROM Evaluation WHERE Name='" + player.Name+"'" ), 0 );
if ( Kick ) return Kick;
else return 0;
}


Add this on CreateTables();

QuerySQL( db, "CREATE TABLE IF NOT EXISTS Evaluation  ( Name VARCHAR(25), Ban INT(18),Kick INT(18))" );


Add these Commands on Commands.nut

else if ( cmd == "einfo" )
{
            if ( !text ) Message( "Error - Syntax: " + cmd + " <FullNick> ");
local q = QuerySQL( db, "SELECT * FROM Evaluation WHERE Name='" + text + "' COLLATE NOCASE" );
if ( !GetSQLColumnData( q, 0 ) )Message( "Error "+text+" -is not An Admin ");
  else
{
    Message( "Evaluation of : " + GetSQLColumnData( q, 0 ) );
    Message( "Evaluation:Bans : " + GetSQLColumnData( q, 1 ) );
    Message( "Evaluation:Kicks : " + GetSQLColumnData( q, 2 ) );
}
}


else if ( cmd == "addadmin" )
{
if ( stats[ player.ID ].Logged == false ) MessagePlayer( "[Error] - You're Not login!", player );
else if ( !text ) MessagePlayer( "Syntax, / " + cmd + " <Name>", player );
else
{
         ClientMessage( "Admin added.", player,255,255,0);
          QuerySQL( db, "INSERT INTO Evaluation (Name, Ban, Kick) values ( '" + text + "', '0', '0' )");
}
}
else if ( cmd == "removeadmin" )
{
if ( stats[ player.ID ].Logged == false ) MessagePlayer( "[Error] - You're Not login!", player );
else if ( !text ) MessagePlayer( "Syntax, / " + cmd + " <Name>", player );
else
{
                QuerySQL( db, "DELETE FROM Evalutation WHERE Name LIKE '%" + text + "%'" );     
           ClientMessage( "Admin deleted.", player,255,255,0);
}               
}


Add this on Kick Function
        SetKick(admin,GetKick(admin)+1);

Add this on Ban Function
    SetBan(admin,GetBan(admin)+1);



Sorry for my disturbence last time on Forum



UPDATED
Beztone is a scripter but he is too stupid

Sk

#1
any player who is not admin can use this command.
Edit:
Nice work.
(only if this wasn't copy pasted from any place).

Sebastian

Quote from: Sk on Apr 01, 2015, 11:26 AMany player who is not admin can use this command.

There is no such function as player.IsAdmin in 0.4. (like we used to have in 0.3, for rcon)
So these permissions are left to be added by users.

Btw, the idea sounds good. If I would have a (more serious) server then I would use this idea. :)

Sk

Quote from: sseebbyy on Apr 01, 2015, 11:44 AM
Quote from: Sk on Apr 01, 2015, 11:26 AMany player who is not admin can use this command.

There is no such function as player.IsAdmin in 0.4. (like we used to have in 0.3, for rcon)
So these permissions are left to be added by users.
ye i know that but he could have left some space for (// Your admin function here) etc. that would have help.

Finch

i didnt not add admin function because many servers has different function of level so they need to have a sense to add their own level function

Thnx Seby
Beztone is a scripter but he is too stupid

soulshaker

Just another copy and paste of 0.3 VCCnR script(made by farisdon). Seriously can't you script something by yourself?

Finch

wth what are u saying i make it my self and i work on it for 1 week everyone is not like u soulshaker just giving money of hosting and become patner
Beztone is a scripter but he is too stupid

MacTavish

Change wPrivMessage to MessagePlayer

Next Time Watch every line before posting this could occurs Error

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

EK.IceFlake

Quote from: Sk on Apr 01, 2015, 11:26 AMany player who is not admin can use this command.
Edit:
Nice work.
(only if this wasn't copy pasted from any place).

Finch

Ok Beztone I will check

Crystal Thanks And its make by my self
Beztone is a scripter but he is too stupid

Honey

#10
Quote from: soulshaker on Apr 01, 2015, 01:02 PMJust another copy and paste of 0.3 VCCnR script(made by farisdon). Seriously can't you script something by yourself?

[OFF] umm, That script was not developed by Faris Don, As far as I know it was an edit of the original script by me and Flockshot but that's very old, Just for knowledge.

soulshaker

Quote from: Honey on Apr 07, 2015, 07:13 AM
Quote from: soulshaker on Apr 01, 2015, 01:02 PMJust another copy and paste of 0.3 VCCnR script(made by farisdon). Seriously can't you script something by yourself?

[OFF] umm, That script was not developed by Faris Don, As far as I know it was an edit of the original script by me and Flockshot but that's very old, Just for knowledge.
I saw this system in vccnr of farisdon before so I mentioned his name. Actually my point is how he released this without giving any credits to the original scripter

Honey

Yeah, When I was a new VCMP scripter I used to do the same, people used to call me copy cat and completely ignore me, eventually I understood that copying things is not good, Some people copy scripts because they consider it much easier instead of making that themselves but there are no shortcuts in scripting, I prefer Finch to use his mind's creativity and make something good, If he encounters problems I'm sure I'll be able to help.

.

Quote from: Honey on Apr 07, 2015, 12:12 PMFinch to use his mind's creativity...

I never thought you are the optimistic type ;D
.

Finch

Well Honey Its Not Copy Paste as i know That the evaluation system that was make by FarisDonb was bugged and i didnt use his system i have proof that his system was bug coz he say me on call i have call him so soulshaker dont think badly because i also say to doom_killer that i work on it for 1 week so this is Proof that i make this or else what u think
Beztone is a scripter but he is too stupid