[Release] Report System

Started by Mohamed Boubekri, Jan 29, 2018, 09:17 PM

Previous topic - Next topic

Mohamed Boubekri

Hello, Many People Say Me, Give Me Link of Any Report Sys, i Don't Find It.
So Now I'm Make It With My Self.

First of All Add it in Your ( OnSriptLoad )
rp <- ConnectSQL("scripts/report.db");
QuerySQL(rp, "create table if not exists report ( Plr TEXT, Name TEXT, Reason TEXT, Day VARCHAR(25), Month VARCHAR(25), Year VARCHAR(25), Hour VARCHAR(25), Min VARCHAR(25) )");
Now Add it In Your Function ( command )
else if ( cmd == "report" )
{
if(!text) MessagePlayer("/report <Player> <Reason>",player);
//Here if You Like Make if player Not Registered
//Here if You Like Make if player Not Logged in
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "You Can't Report yourself.", player );
else {
local now = date();
QuerySQL( rp, "INSERT INTO report ( Plr, Name, Reason, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + player.Name + "', '" + reason + "', '" + now.day + "/', '" + now.month + "/', '" + now.year + "/', '" + now.hour + ":', '" + now.min + "' )" );
MessagePlayer("Report Successfully Inserted To DataBase",player);
Message("Player "+player.Name+" Has Report " +plr.Name+ " Reason: "+reason+"");
}
}
}
}
NOTE: if You Want check who report & reason & time, Just Open The DataBase of The Report System.
NOTE: Thi its Just Sample System. Good Luck.

| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

pro

Good job.
I'd suggest to add more information about "plr" IP/UID/Position/Vehicle and time()
Position/Vehicle may be useful in case of "fly-hack"/"abusing-map-bugs" reports.

Mohamed Boubekri

Hmmmm You Are Right, Will Add Time() Soon.
Thank :)
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Retard


Mohamed Boubekri

#4
Updated. Time Added.
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].


Mohamed Boubekri

| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Retard

An Extra cmd
else if ( cmd == "reportlist" )
{
local query = QuerySQL( rp, "SELECT * FROM report" ), a=0;
if ( !query ) MessagePlayer(RED+"** >> No Players Are Reported.",player);
else {
while ( GetSQLColumnData( query, 0 ) != null )
{
MessagePlayer(RED+"** >> Player:[ "+GetSQLColumnData( query, 0 )+" ] Reported-Player:[ "+GetSQLColumnData( query, 1 )+" ] "+WHITE+"Reason:[ "+GetSQLColumnData( query, 2 )+" ].",player );
GetSQLNextRow( query );
a++;}
}
FreeSQLQuery( query );
}

haxerx

Good Work Man! I like your efforts instead of crying or begging for scripts ;)
Who will have respite to bow their heads. Prostrations, of their own accord shall trickle from the very eyes. We will go out in Yasrib, bereft of familiar company. And deliberately lose our way in streets. Having reached there, we shall not return. Be it that looking for us, people grow weary

Mohamed Boubekri

Quote from: haxerx on Feb 04, 2018, 02:31 PMGood Work Man! I like your efforts instead of crying or begging for scripts ;)
Lol Thanks xD ;)
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce

bro its show only admins?

=RK=MarineForce

untested
else if ( cmd == "report" )
{
if(!text) MessagePlayer("/report <Player> <Reason>",player);
//Here if You Like Make if player Not Registered
//Here if You Like Make if player Not Logged in
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "You Can't Report yourself.", player );
else {
local now = date();
QuerySQL( rp, "INSERT INTO report ( Plr, Name, Reason, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + player.Name + "', '" + reason + "', '" + now.day + "/', '" + now.month + "/', '" + now.year + "/', '" + now.hour + ":', '" + now.min + "' )" );
MessagePlayer("Report Successfully Inserted To DataBase",player);
if ( status[ plr.ID ].Level > 2 )
MessagePlayer("Player "+player.Name+" Has Report " +plr.Name+ " Reason: "+reason+" ", plr);
}
}
}
}

Mohamed Boubekri

| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Mohamed Boubekri

Quote from: =RK=MarineForce on Feb 06, 2018, 03:35 PMuntested
else if ( cmd == "report" )
{
if(!text) MessagePlayer("/report <Player> <Reason>",player);
//Here if You Like Make if player Not Registered
//Here if You Like Make if player Not Logged in
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "You Can't Report yourself.", player );
else {
local now = date();
QuerySQL( rp, "INSERT INTO report ( Plr, Name, Reason, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + player.Name + "', '" + reason + "', '" + now.day + "/', '" + now.month + "/', '" + now.year + "/', '" + now.hour + ":', '" + now.min + "' )" );
MessagePlayer("Report Successfully Inserted To DataBase",player);
if ( status[ plr.ID ].Level > 2 )
MessagePlayer("Player "+player.Name+" Has Report " +plr.Name+ " Reason: "+reason+" ", plr);
}
}
}
}

Thi its not warning system.
Player also can do it. ;D
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

=RK=MarineForce

Nah,

i mean its send message Only Admins not players

look like : Player--- is Report plr Reason Hp hacked

if ( status[ plr.ID ].Level > 2 )
MessagePlayer("Player "+player.Name+" Has Report " +plr.Name+ " Reason: "+reason+" ", plr);