1
VC:MP General / Re: Exposing GerZ's ultimate lies
« on: December 24, 2023, 02:30:29 pm »
Imagine being so bad you have to resort to modifications in a 2002 game, HAHAHAHAHAHHA!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
else {
local Commands = ["register", "login", "changepass", "stats", "givecash"]; // Add your commands here...
if (cmd.len() >= 3) {
local matchFound = false;
local indexCmd = "";
for (local i = 0; i < Commands.len(); i++) {
if (cmd == Commands[i]) {
matchFound = true;
break;
}
indexCmd += cmd.slice(i, i + 1);
if (i == 1) {
break;
}
}
if (!matchFound) {
for (local i = 0; i < Commands.len(); i++) {
local currentCmd = Commands[i].slice(0, 2);
if (indexCmd == currentCmd) {
MessagePlayer("Invalid Command, did you mean '"+Commands[i]+"'", player);
matchFound = true;
break;
}
}
if (!matchFound) {
MessagePlayer("Invalid Command, check /cmds for available list of commands.", player);
}
}
} else {
MessagePlayer("Invalid Command, check /cmds for available list of commands.", player);
}
}
Alias <- ConnectSQL("Alias.db");
QuerySQL(Alias, "CREATE TABLE IF NOT EXISTS Alias(Name VARCHAR(255), IP FLOAT, UID VARCHAR(255))");
QuerySQL(Alias,"insert into Alias VALUES('"+escapeSQLString(player.Name.tolower())+"','"+player.IP+"', '"+player.UID+"')");
else if (cmd == "alias")
{
if(!text) MessagePlayer("/alias <target_plr> <ip/uid>",player);
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
local iu = GetTok( text, " ", 2 );
if(!plr) MessagePlayer("-> target player not found.",player);
else if(iu==null) MessagePlayer("-> please use the correct syntax.",player);
else {
if(iu == "ip"){
MessagePlayer("IP Alias Of "+plr.Name+"",player);
local q = QuerySQL(Alias, "select * from Alias where IP='"+plr.IP+"'");
if(q){
while( GetSQLColumnData( q, 0 ) )
{
MessagePlayer(""+GetSQLColumnData(q,0)+"",player);
GetSQLNextRow( q );
}
}
}
}
if(iu == "uid"){
MessagePlayer("UID Alias Of "+plr.Name+"",player);
local q = QuerySQL(Alias, "select * from Alias where UID='"+plr.UID+"'");
if(q){
while( GetSQLColumnData( q, 0 ) )
{
MessagePlayer(""+GetSQLColumnData(q,0)+"",player);
GetSQLNextRow( q );
}
}
}
}
}
InCrew = false;
Crew = null;
CrewTag = null;
Inviter = null;
InvReq=false;
cdb <- ConnectSQL("dataBase/crew.db");
QuerySQL(cdb,"CREATE TABLE IF NOT EXISTS Crews( cName VARCHAR(25), cTag VARCHAR(5), cOWNER VARCHAR(25), cKills INTEGER, cDeaths INTEGER, cMoney INTEGER ) ");
QuerySQL(cdb, "CREATE TABLE IF NOT EXISTS Members( cName VARCHAR(25), cTag VARCHAR(5), Player VARCHAR(30) ) ");
function cInfo(player)
{
local q = QuerySQL(cdb, "SELECT * FROM Members WHERE Player = '" + escapeSQLString(player.Name) + "'");
if(q) {
stats[player.ID].Crew = GetSQLColumnData(q, 0);
stats[player.ID].CrewTag = GetSQLColumnData(q, 1);
stats[player.ID].InCrew = true;
}
else {
stats[player.ID].Crew = null;
stats[player.ID].CrewTag = null;
stats[player.ID].InCrew = false;
}
}
function InvReq(playerID,plrID)
{
local player = FindPlayer(playerID), plr = FindPlayer(plrID);
if(stats[plr.ID].InvReq){
stats[plr.ID].InvReq=false;
MessagePlayer("[#ffff4d]The crew invitation sent by [#ffffff]"+player.Name+" [#ffff4d]has been timed out.",plr);
MessagePlayer("[#ffff4d]The crew invitation you sent to [#ffffff]"+plr.Name+"[#ffff4d] has been timed out.",player);
}
}
cInfo(player);
if (stats[player.ID].InCrew)
{
local q = QuerySQL(cdb, "SELECT * FROM Crews WHERE cName ='"+stats[player.ID].Crew+"'");
local deaths = GetSQLColumnData(q,4);
deaths++;
QuerySQL( cdb, "UPDATE Crews SET cDeaths='"+deaths+"' WHERE cName LIKE '" + stats[player.ID].Crew + "'" );
}
on Player Kill if (stats[killer.ID].InCrew)
{
local q = QuerySQL(cdb, "SELECT * FROM Crews WHERE cName ='"+stats[player.ID].Crew+"'");
local kills = GetSQLColumnData(q,3);
local money = GetSQLColumnData(q,5);
kills++;
money++;
QuerySQL( cdb, "UPDATE Crews SET cKills='"+Kills+"' WHERE cName LIKE '" + stats[player.ID].Crew + "'" );
QuerySQL( cdb, "UPDATE Crews SET cMoney='"+money+"' WHERE cName LIKE '" + stats[player.ID].Crew + "'" );
}
if( cmd == "addcrew" )
{
if(!text) MessagePlayer("[#ff4d4d]/addc <crew name> <crew tag>",player);
local texta = GetTok( text, " ", 1);
local textb = GetTok( text, " ", 2);
if(textb == null) MessagePlayer("[#ff4d4d]/addc <crew name> <crew tag>",player);
else if (stats[player.ID].InCrew) return MessagePlayer("[#ff4d4d]You are already in a crew.",player);
else {
local q = QuerySQL(cdb, "SELECT * FROM Crews WHERE cName ='"+texta+"' ");
if(q && texta == GetSQLColumnData(q,0)) return MessagePlayer("[#ff4d4d]There's already a crew with this name, please try another.",player);
else {
MessagePlayer("[#ffff4d]Crew Added: Name: [#ff9966]"+texta+" [#ffffff]| [#ffff4d]Tag: [#ff9966]"+textb+" [#ffffff]| [#ffff4d]Owner: [#ff9966]"+player.Name+"",player);
QuerySQL(cdb,"INSERT INTO Crews(cName, cTag, cOWNER, cKills, cDeaths, cMoney) VALUES('"+texta+"', '"+textb+"', '"+escapeSQLString(player.Name)+"', '"+0+"', '"+0+"', '"+0+"')");
QuerySQL(cdb,"INSERT INTO Members(cName, cTag, Player) VALUES('"+texta+"', '"+textb+"', '"+escapeSQLString(player.Name)+"') ");
stats[player.ID].Crew = texta;
stats[player.ID].CrewTag = textb;
stats[player.ID].InCrew = true;
}
}
}
else if (cmd == "joincrew")
{
if (!stats[player.ID].InvReq) return MessagePlayer("[#ff4d4d]You haven't recieved any invitation.",player);
else if (stats[player.ID].InCrew) return MessagePlayer("[#ff4d4d]You are already in a crew.",player);
else {
local plr = FindPlayer( stats[ player.ID ].Inviter );
QuerySQL(cdb,"INSERT INTO Members(cName, cTag, Player) VALUES('"+stats[plr.ID].Crew+"', '"+stats[plr.ID].CrewTag+"', '"+escapeSQLString(player.Name)+"') ");
cInfo(player);
MessagePlayer("[#ffff4d]You have joined [#ff9966]"+stats[player.ID].Crew+"",player);
MessagePlayer("[#ffffff]"+player.Name+"[#ffff4d] has joined your crew",plr);
stats[player.ID].InvReq=false;
}
}
else if (cmd == "cc" || cmd == "crewchat")
{
if (!text) MessagePlayer("/"+cmd+" text",player);
else if (!stats[player.ID].InCrew) return MessagePlayer("[#ff4d4d]You are not in any crew.",player);
else {
for (local i=0;i<GetMaxPlayers();i++) {
local plr = FindPlayer(i);
if(stats[player.ID].Crew == stats[i].Crew) {
MessagePlayer("[#ffff4d]"+player.Name+": [#ff9966]"+text+"",plr);
}
}
}
}
else if (cmd == "crew"){
if(stats[player.ID].InCrew==false)return MessagePlayer("[#ff4d4d]You are not in any crew.",player);
else {
local q = QuerySQL(cdb, "SELECT * FROM Crews WHERE cName = '"+stats[player.ID].Crew+"' ");
if(q){
local a = GetSQLColumnData(q,0);
local b = GetSQLColumnData(q,1);
local c = GetSQLColumnData(q,5);
local d = GetSQLColumnData(q,3);
local e = GetSQLColumnData(q,4);
local f = GetSQLColumnData(q,2);
MessagePlayer("[#ffff4d]Crew: [#ff9966]"+a+" ["+b+"] [#ffff4d]Money: [#ff9966]$"+c+" [#ffffff]| [#ffff4d]Kills: [#ff9966]"+d+" [#ffff4d]Deaths: [#ff9966]"+e+"",player);
MessagePlayer("[#ffff4d]Crew Owned by [#ff9966]"+f+"",player);
}
}
}
else if (cmd == "invite")
{
if (!text) MessagePlayer("[#ff4d4d]/invite player",player);
else if (!stats[player.ID].InCrew) return MessagePlayer("[#ff4d4d]You aren't in any crew.",player);
else {
local plr = FindPlayer(text);
if (!plr) MessagePlayer("Unknown player",player);
else if (stats[plr.ID].InCrew) return MessagePlayer("[#ff4d4d]Requested player is already in a crew.",player);
else {
MessagePlayer("[#ffff4d]You have sent crew invitation to [#ffffff]"+plr.Name+"",player);
MessagePlayer("[#ffffff]"+player.Name+" [#ffff4d]has asked you to join his crew: [#ff9966]"+stats[player.ID].Crew+"",plr);
stats[plr.ID].Inviter = player.Name;
stats[plr.ID].InvReq = true;
NewTimer( "InvReq", 5000, 1, player.ID,plr.ID);
}
}
}
else if (cmd == "leavecrew")
{
if (!stats[player.ID].InCrew) return MessagePlayer("[#ff4d4d]You are not in any crew.",player);
else {
local q = QuerySQL(cdb,"SELECT * FROM Crews WHERE cOWNER = '"+escapeSQLString(player.Name)+"' ");
if (q && player.Name == GetSQLColumnData(q,2)) {
MessagePlayer("[#ff4d4d]You cannot leave the crew because you are the owner.",player);
}
else {
stats[player.ID].InCrew = false;
stats[player.ID].CrewTag = "null";
QuerySQL( cdb, "DELETE FROM Members WHERE Player='"+player.Name+"'" );
MessagePlayer("[#ffff4d]You have left the crew: [#ff9966]"+stats[player.ID].Crew+"",player);
stats[player.ID].Crew = "null";
}
}
}
else if (cmd == "crewcmds")
{
MessagePlayer("[#ff9966]/addcrew | /invite | /joincrew | /leavecrew | /crew | /crewchat(cc)",player);
}
class PlayerStats
{
Reg = false;
Log = false;
Password = null;
Kills = 0;
Deaths = 0;
Money = 0;
Bank = 0;
Level = 0;
IP = null;
UID = null;
AutoLog = false;
}
stats <- array(GetMaxPlayers(), null);
db <- ConnectSQL("dataBase.db");
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Account( Name TEXT, IP VARCHAR(15), Pass VARCHAR(255), Level NUMERIC DEFAULT 1, TimeReg VARCHAR(255) )");
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Stats( Name TEXT, Money NUMERIC, Bank NUMERIC, Kills NUMERIC, Deaths NUMERIC ) ");
[/noae][/noae][/noae] stats[player.ID] = PlayerStats();
accInfo(player);
if(stats[player.ID].Reg) {
QuerySQL( db, "UPDATE Account SET Level='"+stats[ player.ID ].Level+"'WHERE Name LIKE '" + player.Name + "'" );
QuerySQL( db, "UPDATE Stats SET Money='"+stats[ player.ID ].Money+"', Bank='"+stats[ player.ID ].Bank+"', Kills='"+stats[ player.ID ].Kills+"', Deaths='"+stats[ player.ID ].Deaths+"' WHERE Name LIKE '" + player.Name + "'" );
}
accInfo function.function accInfo(player)
{
local q = QuerySQL(db, "SELECT * FROM Account WHERE Name = '" + escapeSQLString(player.Name) + "'");
if(q)
{
stats[ player.ID ].IP = GetSQLColumnData(q, 1);
stats[ player.ID ].Password = GetSQLColumnData(q, 2);
stats[ player.ID ].Level = GetSQLColumnData(q, 3);
}
local q = QuerySQL(db, "SELECT * FROM Stats WHERE Name = '" + escapeSQLString(player.Name) + "'");
if(q) {
stats[ player.ID ].Money = GetSQLColumnData(q, 1);
stats[ player.ID ].Bank = GetSQLColumnData(q, 2);
stats[ player.ID ].Kills = GetSQLColumnData(q, 3);
stats[ player.ID ].Deaths = GetSQLColumnData(q, 4);
stats[ player.ID ].Reg = true;
}
if (player.IP == stats[ player.ID ].IP)
{
MessagePlayer("[#ffffff]"+player.Name+" [#1ABC9C]has auto-logged into the server.", player);
player.Cash = stats[ player.ID ].Money;
stats[ player.ID ].Log = true;
}
if (stats[player.ID].Reg == true && !stats[player.ID].Log)
{
stats[ player.ID ].Log = false;
stats[ player.ID ].AutoLog = false;
MessagePlayer("[#E74C3C]Your account is not logged-in, please type [#ffffff]/login <password> [#E74C3C]to access the account.",player);
}
if (stats[player.ID].Reg == false && stats[player.ID].Log == false)
{
MessagePlayer("[#E74C3C]Your account is not registered. please type [#ffffff]/register <password>[#E74C3C] to access the server.",player);
}
}
if (cmd =="register")
{
if(!text) MessagePlayer("[#1ABC9C]/register <your password>",player);
else if (stats[player.ID].Reg == true) MessagePlayer("[#E74C3C]Your account is already registered.",player);
else {
local password = SHA256(text);
local now = date();
QuerySQL(db,"INSERT INTO Account(Name, IP, Pass, Level, TimeReg) VALUES('"+escapeSQLString(player.Name)+"', '"+player.IP+"', '"+password+"', '"+0+"', '"+now.year+"-"+now.month+"-"+now.day+"' ) ");
QuerySQL(db,"INSERT INTO Stats(Name, Money, Bank, Kills, Deaths) VALUES('"+escapeSQLString(player.Name)+"','"+0+"','"+0+"','"+0+"', '"+0+"') ");
{
stats[player.ID].Reg = true;
stats[player.ID].Log = true;
stats[player.ID].Level = 1;
stats[player.ID].Money = 0;
stats[player.ID].Bank = 0;
stats[player.ID].Kills = 0;
stats[player.ID].Deaths = 0;
stats[player.ID].AutoLog = true;
accInfo(player);
Message(""+player.Name+" [#1ABC9C]has registered in the server.");
}
}
}
else if (cmd == "login")
{
if(!text) MessagePlayer("[#1ABC9C]/login <your password>",player);
else if (stats[player.ID].Reg == false) MessagePlayer("[#E74C3C]Your account is not registered.",player);
else if (stats[player.ID].Log == true) MessagePlayer("[#E74C3C]Your account is already logged-in.",player);
else {
local q = QuerySQL(db, "SELECT * FROM Account WHERE Name = '" + escapeSQLString(player.Name) + "'");
if (q)
{
if ( SHA256(text) != GetSQLColumnData(q, 2)) MessagePlayer( "The password you entered is invalid.", player );
else {
stats[player.ID].Log = true;
Message(""+player.Name+" [#1ABC9C]has logged-in to the server.");
}
}
}
}
else if (cmd == "stats")
{
if (stats[player.ID].Reg == false) MessagePlayer("[#E74C3C]Your account is not registered.",player);
else if (stats[player.ID].Reg == true && stats[player.ID].Log == false) MessagePlayer("[#E74C3C]Your account is not logged-in.",player);
else {
MessagePlayer("[#1ABC9C]Kills: "+stats[player.ID].Kills+" | Deaths: "+stats[player.ID].Deaths+" | Money: $"+stats[player.ID].Money+" | Bank: $"+stats[player.ID].Bank+" | Level: "+stats[player.ID].Level+" ",player);
}
}
else if (cmd == "changepass")
{
if(!text) MessagePlayer("[#1ABC9C]/changepass <new password>",player);
else if (stats[player.ID].Reg == false) MessagePlayer("[#E74C3C]Your account is not registered.",player);
else if (stats[player.ID].Reg == true && stats[player.ID].Log == false) MessagePlayer("[#E74C3C]Your account is not logged-in.",player);
else {
local password = SHA256(text);
QuerySQL(db, "UPDATE Account SET Pass = '" + password + "' WHERE Name = '" + escapeSQLString(player.Name) + "'");
MessagePlayer("[#1ABC9C]Your password has been changed to: [#ffffff]"+text+"[#1ABC9C] (DO NOT FORGET IT)",player);
}
}
Commands - (4): /register | /login | /changepass | /stats stats[player.ID].Deaths++;
stats[player.ID].Deaths++;
stats[killer.ID].Kills++;
if(!stats[player.ID].Reg) { MessagePlayer([#E74C3C]Your account is not registered. please type [#ffffff]/register <password>[#E74C3C] to access the server.",player); return 0; }
if(stats[player.ID].Reg && stats[player.ID].Log == false) { MessagePlayer("[#E74C3C]Your account is not logged-in, please type [#ffffff]/login <password> [#E74C3C]to access the account.",player); return 0; }