May 08, 2024, 01:00:21 pm

Show Posts

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.


Topics - GiTo

Pages: [1] 2
1
Script Showroom / Gitto's Clan System.
« on: May 28, 2023, 04:05:20 pm »
Hello everyone! I've been learning about loops, variables, and arrays, and as a practice exercise, I've developed a Clan System. I've uploaded the code on GitHub, and you can access it using the following link: https://github.com/sibghatcodez/-VCMP-ClanSystem

To get started, please follow the instructions provided in the 'essentials.nut' file. By following those instructions, the code should function correctly.

Here's a list of commands available for Clan Members:

  • /createclan: Create a new clan.
  • /accept: Accept an invitation to join a clan.
  • /clanchat (or /cc): Chat with other clan members.
  • /leaveclan: Leave your current clan.
  • /clans: View a list of all clans.
  • /clan: View information about your current clan.
  • /clanmembers: View a list of members in your clan.
  • /ranks: View the ranks available in your clan.
  • /request: Send a request to join a clan.

For Clan Owners, additional commands are available:
  • /invite: Invite a player to join your clan.
  • /kick: Remove a member from your clan.
  • /giveclancash: Give clan cash to a member.
  • /setdefrank: Set the default rank for new clan members.
  • /addrank: Add a new rank to your clan.
  • /delrank: Delete an existing rank from your clan.
  • /setrank: Set a member's rank in the clan.
  • /transferownership: Transfer ownership of the clan to another member.
  • /setting: Adjust various settings for your clan. (teamID, skinID, enable/disable Tags)
  • /acceptrequest: Accept pending join requests.
  • /deleteclan (or /delclan): Delete your clan.


--> If you encounter any bugs or have any questions, feel free to reach out to me on Discord. I'm usually online and active.


Here are some screenshots of the Clan System in action.







2
Script Showroom / [Snippet] a small useful feature.
« on: April 05, 2023, 09:17:16 am »
Put this at the end of your onPlayerCommand & it should work correctly!


Code: [Select]
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);
}
}

Explanation:This code block checks if the player has entered a valid command if the player enters an incorrect command it suggests the correct command this helps prevent errors and confusion for the player.


P.S: Please let me know if you encounter any bugs or have any suggestions for improvement.

3
Script Showroom / Simple alias script.
« on: February 10, 2023, 02:42:19 pm »
Tried making alias system on my own
Tested working fine 101%!

Creating Database
Code: [Select]
Alias <- ConnectSQL("Alias.db");
QuerySQL(Alias, "CREATE TABLE IF NOT EXISTS Alias(Name VARCHAR(255), IP FLOAT, UID VARCHAR(255))");

ADD THIS LINE ON REGISTER COMMAND ->
Code: [Select]
QuerySQL(Alias,"insert into Alias VALUES('"+escapeSQLString(player.Name.tolower())+"','"+player.IP+"', '"+player.UID+"')");

ADD THIS ON onPlayerCommand ->
Code: [Select]
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 );
              }
            }
        }
    }
}


although this one is better -> https://viceunderdogs.com/index.php?topic=1842.0

4
Off Topic / Is the vcmp forum down?
« on: January 05, 2023, 10:40:30 am »
The forum is not working for me for last 2 days I wonder what had happened with it and will it come back 😢

5
Script Showroom / Crew/Gang sys-
« on: November 15, 2022, 12:39:19 pm »
Crew System


Crew Class

Code: [Select]
InCrew = false;
Crew = null;
CrewTag = null;
Inviter = null;
InvReq=false;

on Script Load
Code: [Select]
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(s)
Code: [Select]
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);

}
}

on Player Join
Code: [Select]
cInfo(player);

on Player Death
Code: [Select]
        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
Code: [Select]
        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 + "'" );
}

on Player Command
Code: [Select]
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);
}

Total commands (6): /addcrew | /invite | /joincrew | /leavecrew | /crew | /crewchat(cc).



6
Script Showroom / Account sys
« on: November 15, 2022, 12:38:12 pm »
CLASS.
Code: [Select]
class PlayerStats
{


Reg = false;
Log = false;
Password = null;

Kills = 0;
Deaths = 0;

Money = 0;
Bank = 0;
Level = 0;

IP = null;
UID = null;
AutoLog = false;
}

onScriptLoad.

Code: [Select]
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]

onPlayerJoin.
Code: [Select]
    stats[player.ID] = PlayerStats();
    accInfo(player);


onPlayerPart.
Code: [Select]
    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.
Code: [Select]
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);
}
}

Commands.
Code: [Select]
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

onPlayerDeath.
Code: [Select]
        stats[player.ID].Deaths++;

onPlayerKill.
Code: [Select]
    stats[player.ID].Deaths++;
    stats[killer.ID].Kills++;

onPlayerRequestSpawn.
Code: [Select]
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; }

Hello guys so it's me again ;D first time trying to make my own account system it might have alot of bugs if you encounter any so please let me know. The script is tested btw.



7
Server Discussion / Deathmatch Smashing ZonE.
« on: July 12, 2022, 09:22:52 am »


Hello lads! Presenting you DeathMatch Smashing ZonE led by Gitto and scripted by Gitto, Atom and OreoT.

The server game mode is based on normal death matching. There are many minigames which you can play while you get bored like WaterFight, GunGame, Parkour and TDM(like in PUBG)

There are many ways to earn dtc (dtc is our currency name "DeathMatch Coin")

If you face any issue you can contact us at our discord server, here's the invite link:  DSZ DISCORD

We do not have any forum and we have no intent in making one so everything will be on discord.

Server IP: 51.178.65.136-8282

Thanks for reading!

8
Script Showroom / ( Simple ) Nogoto on/off system.
« on: July 18, 2021, 07:58:28 am »
NOGOTO SYSTEM BY GITO

Class

Code: [Select]
Class PlayerStats{
nogoto = false;
}

Database
Code: [Select]
function onScriptLoad() {
nogoto <- ConnectSQL("Nogoto.db");
QuerySQL(nogoto, "create table if not exists nogoto ( Name Text ,nogoto TEXT) ");
}

Database Close
Code: [Select]
function onScriptUnload() {
DisconnectSQL(nogoto);
}

Functions
Code: [Select]
function Nogoto(player)
{
    local q = QuerySQL(nogoto, "SELECT * FROM nogoto WHERE Name = '" + escapeSQLString(player.Name) + "'");
    if (q)
    {
        stats[ player.ID ].nogoto = GetSQLColumnData( q, 1 );
    }
    else QuerySQL( nogoto, "INSERT INTO nogoto ( Name, nogoto ) VALUES ( '" + escapeSQLString(player.Name) + "', ' false ' )" );
}

function Nogotodb(player)
{
    QuerySQL( nogoto, "UPDATE nogoto SET nogoto='"+ stats[ player.ID ].nogoto +"' WHERE Name = '"+player.Name+"'");
}


PlayerJoin
Code: [Select]
function onPlayerJoin(player){
Nogoto(player);
}

PlayerPart
Code: [Select]
function onPlayerPart(player); {
Nogotodb(player);
}

PlayerCommand
Code: [Select]
function onPlayerCommand(player, cmd, text){
else if(cmd == "nogoto")
{
if(!text) MessagePlayer("[#ff0000]Error: [#ffffff]/" + cmd + " <on/off>", player);
else
{
if(text == "on" || text == "1" || text == "set" || text == "true")
{
                local q = QuerySQL(nogoto, "SELECT * FROM nogoto WHERE Name = '" + player.Name + "'");
            if (stats[player.ID].nogoto == true) MessagePlayer("[#ff0000]Error: [#ffffff]Nogoto is already on!",player);
            else if( q && GetSQLColumnData(q, 1) == "true" ) MessagePlayer("[#ff0000]Error: [#ffffff]Nogoto is already on!",player);
else {
stats[player.ID].nogoto = true;
MessagePlayer("[#ffa447]Nogoto has been turned on, Now no one will be able to teleport to you.",player);
QuerySQL( nogoto, "UPDATE nogoto SET nogoto='"+ stats[ player.ID ].nogoto +"' WHERE Name = '"+player.Name+"'");
        }
        }
if(text == "off" || text == "0" || text == "del" || text == "false")
{
            if (stats[player.ID].nogoto == false) MessagePlayer("[#ff0000]Error: [#ffffff]Nogoto is already off!",player);
else {
stats[player.ID].nogoto = false;
MessagePlayer("[#ffa447]Nogoto has been turned off, Everyone will be able to teleport to you.",player);
     QuerySQL( nogoto, "UPDATE nogoto SET nogoto='"+ stats[ player.ID ].nogoto +"' WHERE Name = '"+player.Name+"'");
}
    }
}
return 0;
}
}



Goto Line
Put this on goto command
Code: [Select]
        local q = QuerySQL(nogoto, "SELECT * FROM nogoto WHERE Name = '" + plr.Name + "'");
    if( q && GetSQLColumnData(q, 1) == "true" ) MessagePlayer("[#ff0000]Error: [#ffffff]Target player has his nogoto enabled!",player);
        else if (stats[plr.ID].nogoto == true) MessagePlayer("[#ff0000]Error: [#ffffff]Target player has his nogoto enabled!",player);






9
Script Showroom / ( Simple ) Ban System.
« on: July 11, 2021, 06:41:06 am »
Ban System (DURATION)


Creating Database
Code: [Select]
DataBase <- ConnectSQL("Databases/BanSys.db");   
QuerySQL(DataBase, "create table if not exists Bans ( Name TEXT, UID TEXT, UID2 TEXT, Admin TEXT, Reason TEXT, Time INTEGER, IP REAL)");

onPlayer Join
Code: [Select]
CheckBan( player );

OnPlayer Command
Code: [Select]
else if (cmd == "ban")
{
if (!stats[player.ID].Registered) return MessagePlayer("[#ff0000]Error: [#ffffff]You should be registered to use this command.",player);
else if (!stats[player.ID].Logged) return MessagePlayer("[#FF0000]You're Not Logged in.", player);
else if ( stats[ player.ID ].Level < 3 ) return MessagePlayer("[#FF0000]You don't have Authorization to to use this command.", player);
else if ( !text ) PrivMessage( player, format( "Error: Use /%s <player> Days Hours Reason", cmd ) );
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( plr )
{
local d = GetTok( text, " ", 2 ), h = GetTok( text, " ", 3 );
local reason = GetTok( text, " ", 4 NumTok( text, " " ) );
if (!IsNum(d)) return MessagePlayer("[#FF0000]Error: Days Must be in integers.",player);
else if (!IsNum(h)) return MessagePlayer("[#FF0000]Error: Hours Must be in integers.",player);
else if (!reason) return MessagePlayer("[#FF0000]ERROR: Reason is Missing.",player);
else if ( reason && d && h && IsNum( d ) && IsNum( h ) ) Ban( plr, player.Name, reason, d.tointeger(), h.tointeger() );
}
else MessagePlayer("Invalid Player.",player);
}
        return 0;
}


else if (cmd == "unban")
{
        if(stats[player.ID].Level < 3) MessagePlayer("[#ff0000]Error: [#ffffff]You don't have permission to use this command.",player);
        else if (!text) MessagePlayer("Correct syntax - /"+cmd+" Full player name",player);
else
{
DelBan( player.Name, text );
Message("[#ffffff]"+player.Name + "[#25A5F9] has unbanned[#ffffff] ( " + text + " ) ");
}
        return 0;
}

Functions
Code: [Select]
function Ban( player, admin, reason, d, h )
{
local name = player.Name.tolower(), Time = time() + d * 86400 + h * 3600;
QuerySQL( DataBase, "INSERT INTO Bans ( Name, UID, UID2, Admin, Reason, Time, IP ) VALUES ( '" + name + "', '" + player.UniqueID + "', '" + player.UniqueID2 + "', '" + admin + "', '" + reason + "', '" + Time.tointeger() + "', '" + player.IP + "')" );
Message( admin + " banned " + name + ", reason:[ " + reason + " ] time: [ " + d + " days, " + h + " hours ]." );
KickPlayer( player );
}
function GetLastDay( t1, t2 )
{
    local time = t2 - t1, min = ( time / 60 ).tointeger(), week = 0, hour = 0, day = 0;
while( min >= 60 ) { hour += 1; min -= 60; }
while( hour >= 24 ) { day += 1; hour -= 24; }
while( day >= 7 ) { week += 1; day -= 7; }
return ( week == 0 ? day + " days " + hour + " hours " + min + " minutes" : week + " weeks " + day + " days" );
}
function CheckBan( plr )
{
local q = QuerySQL( DataBase, "SELECT * FROM Bans WHERE UID='" + plr.UniqueID + "'" ), q2, q3;
if ( q )
{
local time1 = GetSQLColumnData( q, 5 ).tointeger();
if ( time1 && time() >= time1 )
{
QuerySQL( DataBase, "DELETE FROM Bans WHERE UID='" + plr.UniqueID + "'" );
FreeSQLQuery(q);
return false;
}
    local admin = GetSQLColumnData( q, 3 ), reason = GetSQLColumnData( q, 4 ), relname = GetSQLColumnData( q, 0 );

Message( "Player-Banned [ " + plr.Name + " ], Admin:[ " + admin + " ], Reason:[ " + reason + " ], Time Left:[ " + GetLastDay( time(), time1 ) + " ]." );
    KickPlayer( plr );
FreeSQLQuery( q );
return true;
}
else
{
q2 = QuerySQL( DataBase, "SELECT * FROM Bans WHERE IP='" + plr.IP + "'" );
if ( q2 )
{
local time1 = GetSQLColumnData( q2, 5 ).tointeger();
if ( time1 && time() >= time1 )
{
QuerySQL( DataBase, "DELETE FROM Bans WHERE IP='" + plr.IP + "'" );
FreeSQLQuery(q2);
return false;
}
      local admin = GetSQLColumnData( q2, 3 ), reason = GetSQLColumnData( q2, 4 ), relname = GetSQLColumnData( q2, 0 );

Message( "Player-Banned [ " + plr.Name + " ], Admin:[ " + admin + " ], Reason:[ " + reason + " ], Time Left:[ " + GetLastDay( time(), time1 ) + " ]." );
    KickPlayer( plr );
FreeSQLQuery( q2 );
return true;
}
else
{
q3 = QuerySQL( DataBase, "SELECT * FROM Bans WHERE LOWER(Name)='" + plr.Name.tolower() + "'" );
if ( q3 )
{
local time1 = GetSQLColumnData( q3, 5 ).tointeger();
if ( time1 && time() >= time1 )
{
QuerySQL( DataBase, "DELETE FROM Bans WHERE LOWER(Name)='" + plr.Name + "'" );
FreeSQLQuery(q3);
return false;
}
      local admin = GetSQLColumnData( q3, 3 ), reason = GetSQLColumnData( q3, 4 ), relname = GetSQLColumnData( q3, 0 );

Message( "Player-Banned [ " + plr.Name + " ], Admin:[ " + admin + " ], Reason:[ " + reason + " ], Time Left:[ " + GetLastDay( time(), time1 ) + " ]." );
    KickPlayer( plr );
FreeSQLQuery( q3 );
return true;
}
}
}
try
{
FreeSQLQuery( q );
if ( q2 ) FreeSQLQuery( q2 );
if ( q3 ) FreeSQLQuery( q3 );
}
catch(e)
return false;
}

function DelBan( admin, banned )
{
QuerySQL( DataBase, "DELETE FROM Bans WHERE Name='" + banned.tolower() + "'" );
Message( "done." );
}

10
Script Showroom / ( Simple ) Admin System.
« on: July 11, 2021, 06:28:05 am »
----------///---LEVEL SYSTEM---\\\----------

Player Class
Code: [Select]
class PlayerClass
{
    Level = 0;
}

Creating Database
Code: [Select]
Admin <- ConnectSQL("Level.db");
QuerySQL(Admin, "create table if not exists Level ( Name Text ,Level NUMERIC DEFAULT 0) ");

Functions
Code: [Select]
function AdminInfo(player)
{
    local q = QuerySQL(Admin, "SELECT * FROM Level WHERE Name = '" + escapeSQLString(player.Name) + "'");
    if (q)
    {
        stats[ player.ID ].Level = GetSQLColumnData(q, 1);
    }
    else QuerySQL( Admin, "INSERT INTO Level ( Name, Level ) VALUES ( '" + escapeSQLString(player.Name) + "', ' 0 ' )" );
}

function SaveAdmin(player)
{
    QuerySQL( Admin, "UPDATE Level SET Level='"+ stats[ player.ID ].Level +"' WHERE Name = '"+player.Name+"'");
}

OnPlayer Join
Code: [Select]
AdminInfo();

OnPlayer Part
Code: [Select]
SaveAdmin();
Set Level Command
Code: [Select]
   else if ( ( cmd == "setlevel" ) || ( cmd == "setlvl" ) )
{
if ( stats[ player.ID ].Level < 5 ) MessagePlayer("[#ff0000]Error: [#ffffff]You don't have permission to use this command.",player);
else if ( !text ) PrivMessage( player, format( "Error: Use /%s <player> <Level>", cmd ) );
else
{
local txt = split( text, " " );
if ( txt.len() >= 2 )
{
local plr = FindPlayer( txt[ 0 ] ), lvl = txt[ 1 ];
if ( !plr ) PrivMessage( player, "Error: Unknown player." );
else if ( !IsNum( lvl ) ) ClientMessage( player, "Error: Level must be in numbers...",player, 255, 0, 0 );
else if ( ( lvl.tointeger() < 1 ) || ( lvl.tointeger() > 7 ) ) ClientMessage( "ERROR: Allowed Level amount are between 1 and 7.", player, 255, 0, 0 );
else if ( stats[ plr.ID ].Level == lvl.tointeger() ) PrivMessage( player, format( "Error: %s's Level is %d already.", plr.Name, lvl.tointeger() ) );
else
{
stats[ plr.ID ].Level = lvl.tointeger();
Message( "[#ffffff]"+player.Name+" [#25AAAA]changed the level of[#ffffff] "+plr.Name+"[#25AAAA] to [#ffffff]["+lvl.tointeger()+"].");
                }
}
else PrivMessage( player, format( "Error: Usage /%s <player> <Level>", cmd ) );
}
return 0;
}

Example command
Code: [Select]
else if ( cmd=="assrocket")
{
if(stats[player.ID].Level < 2) return MessagePlayer("[#ff0000]Error: [#ffffff]You don't have permission to use this command.",player);
else
{
if (!text) MessagePlayer("[#51FF06]Usage :[#FFFFFF] /assrocket <Name/ID>",player);
else
{
local plr = FindPlayer(text);
plr.Pos = player.Pos;
Message("[#ffffff]"+player.Name+ "[#25AAAA] has bombed [#ffffff]" +plr.Name);
CreateExplosion( 1, 1,plr.Pos.x -3 , plr.Pos.y -5, plr.Pos.z, -1, true );
CreateExplosion( 1, 2,plr.Pos.x -3, plr.Pos.y -5, plr.Pos.z, -1, true );
CreateExplosion( 1, 3,plr.Pos.x -3, plr.Pos.y -5, plr.Pos.z, -1, true );
CreateExplosion( 1, 4,plr.Pos.x -3 , plr.Pos.y -5, plr.Pos.z, -1, true );
}
}
return 0;
}

11
Guides / How to add custom wep icons in vice city. (TUTORIAL)
« on: March 15, 2021, 12:14:59 pm »

12
Off Topic / Gito Baloch's Youtube Channel. | Guess he District Name.
« on: March 11, 2021, 04:57:48 pm »
CTB x SCAM 1992 | MONTAGE | VCMP


13
General Discussion, Betting and FAQs / Withdraw from event.
« on: July 30, 2020, 03:50:45 pm »
i don't want to play. i losed 1 match bye good luck  :thumbsup:

14
Fighter Registrations / Application [R2x]Gito_OP
« on: July 12, 2020, 11:09:33 am »
Nickname: [R2x]Gito_OP
Average Ping in any Europian server: 120-150.
Location: Pakistan.
Timezone (GMT +/-): GMT +5.

15
Off Topic / Guys...
« on: May 08, 2020, 05:07:32 am »
WTF I DID REMOVE THIS TOPIC PLEASE... :(

Pages: [1] 2