Menu

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.

Show posts Menu

Messages - MRSK143

#1
Servers / An Appeal To save my server
Aug 02, 2022, 04:50 PM
Hi @AdTec_224 , I've got an appeal to ban [Sb]Hunter Hosting IP he has stolen my server files somehow and he is hosting the server with the same name as my server Battle Royal and I appeal to you to ban his IP Address soon as possible and must ban him from VCMP community(optional lol) The hosting IP Address he is using: 116.203.83.81:8192
Please ban his IP soon as possible

Regards @MRSK143
#2
Hi buddies, I created Spawn Weapon System because I just found only spawn weapon and it was bugged :/
So I decided to create my own Spawn Weapon System

Here is the code

Paste the spawn weapon class in the top of your main.nut file

class SpawnWeps
{
SpawnWepStatus = false;
SpawnWeps = null;
}

Paste this code on script load event

Spawnweps <- ConnectSQL("SpawnWep.db");
QuerySQL( Spawnweps, "CREATE TABLE IF NOT EXISTS SpawnWep(Name TEXT DEFAULT NULL, SpawnWepStatus BOOLEAN DEFAULT FALSE, Wep1 NUMERIC DEFAULT 0, Wep2 NUMERIC DEFAULT 0, Wep3 NUMERIC DEFAULT 0, Wep4 NUMERIC DEFAULT 0, Wep5 NUMERIC DEFAULT 0, Wep6 NUMERIC DEFAULT 0, Wep7 NUMERIC DEFAULT 0, Wep8 NUMERIC DEFAULT 0, Wep9 NUMERIC DEFAULT 0 )" );
spawnwep <- array(GetMaxPlayers(), null);
print("Spawn Weapon System by MR SK has been loaded successfully!");

Paste this line on player join event

GetSpawnWepData(player);
Paste this line on player spawn event

AssignSpawnWeps(player);
Now here are the commands

if(cmd == "spawnwep")
{
if(text)
{
QuerySQL( Spawnweps, "UPDATE SpawnWep SET Wep1='0',Wep2='0',Wep3='0',Wep4='0',Wep5='0',Wep6='0',Wep7='0',Wep8='0',Wep9='0' WHERE Name LIKE '" + escapeSQLString(player.Name) + "'" );
local ptext = split(text " ");
spawnwep[player.ID].SpawnWepStatus = true;
QuerySQL( Spawnweps, "UPDATE SpawnWep SET SpawnWepStatus='true' WHERE Name LIKE '" + escapeSQLString(player.Name) + "'" );
local wepnames = "";
foreach(wep in ptext)
{
local weaponId = IsNum(wep) ? wep.tointeger() : GetWeaponID(wep);
QuerySQL( Spawnweps, "UPDATE SpawnWep SET "+GetWepColumn(GetWeaponSlot(weaponId))+"='"+weaponId+"' WHERE Name LIKE '" + escapeSQLString(player.Name) + "'" );
player.GiveWeapon(weaponId, 9999);
wepnames += wepnames != "" ? format(", %s", GetWeaponName(weaponId)) : GetWeaponName(weaponId);
}
local q = QuerySQL(Spawnweps, "SELECT * FROM SpawnWep WHERE Name = '" + escapeSQLString(player.Name) + "'");
if(q != null)
{
spawnwep[player.ID].SpawnWeps = [GetSQLColumnData(q, 2).tointeger(), GetSQLColumnData(q, 3).tointeger(), GetSQLColumnData(q, 4).tointeger(), GetSQLColumnData(q, 5).tointeger(), GetSQLColumnData(q, 6).tointeger(), GetSQLColumnData(q, 7).tointeger(), GetSQLColumnData(q, 8).tointeger(), GetSQLColumnData(q, 9).tointeger(), GetSQLColumnData(q, 10).tointeger()];
}
if(wepnames != "")
{
MessagePlayer("[#00FF00][SPAWN WEP]: [#FFFFFF]You have set your spawn weapons to "+wepnames+" successfully!", player);
}
return 0;
}
else MessagePlayer("[#FFFF00]Syntax; /spawnwep <Weps Name/ID>", player);
}

else if(cmd == "spawnwepdel")
{
if(spawnwep[player.ID].SpawnWepStatus == true)
{
MessagePlayer("[#00FF00][SPAWN WEP]: [#FFFFFF]You have disabled your spawn weapons successfully!", player);
QuerySQL( Spawnweps, "UPDATE SpawnWep SET SpawnWepStatus='false', Wep1='0',Wep2='0',Wep3='0',Wep4='0',Wep5='0',Wep6='0',Wep7='0',Wep8='0',Wep9='0' WHERE Name LIKE '" + escapeSQLString(player.Name) + "'" );
spawnwep[player.ID].SpawnWepStatus = false;
spawnwep[player.ID].SpawnWeps = null;
}
else MessagePlayer("[#FF0000][ERROR]: Your spawn weapons are already disabled!", player);
return 0;
}

Now finally at last the function for this Spawn Weapons System are here

function GetSpawnWepData(player)
{
spawnwep[player.ID] = SpawnWeps();
local q = QuerySQL(Spawnweps, "SELECT * FROM SpawnWep WHERE Name = '" + escapeSQLString(player.Name) + "'");
if(q != null)
{
spawnwep[player.ID].SpawnWeps = [GetSQLColumnData(q, 2).tointeger(), GetSQLColumnData(q, 3).tointeger(), GetSQLColumnData(q, 4).tointeger(), GetSQLColumnData(q, 5).tointeger(), GetSQLColumnData(q, 6).tointeger(), GetSQLColumnData(q, 7).tointeger(), GetSQLColumnData(q, 8).tointeger(), GetSQLColumnData(q, 9).tointeger(), GetSQLColumnData(q, 10).tointeger()];
if(GetSQLColumnData(q, 1) == "true")
{
spawnwep[player.ID].SpawnWepStatus = true;
}
else{
spawnwep[player.ID].SpawnWepStatus = false;
}
}
else{
QuerySQL(Spawnweps, "INSERT INTO SpawnWep( Name, SpawnWepStatus, Wep1, Wep2, Wep3, Wep4, Wep5, Wep6, Wep7, Wep8, Wep9 ) VALUES ('"+escapeSQLString(player.Name)+"', 'false', '0', '0', '0', '0', '0', '0', '0', '0', '0' )" );
}
}

function AssignSpawnWeps(player)
{
if(spawnwep[player.ID].SpawnWepStatus == true)
{
player.Disarm();
foreach(weps in spawnwep[player.ID].SpawnWeps)
{
player.GiveWeapon(weps, 9999);
}
MessagePlayer("[#00FF00][SPAWN WEP]: [#FFFFFF]You've spawned with your spawn weapons!", player);
}
}

function GetWeaponSlot(weapon){
switch(weapon.tointeger())
{
case 0:
case 1:
return 0;

case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
return 1;

case 12:
case 13:
case 14:
case 15:
case 16:
return 2;

case 17:
case 18:
return 3;

case 19:
case 20:
case 21:
return 4;

case 22:
case 23:
case 24:
case 25:
return 5;

case 26:
case 27:
return 6;

case 30:
case 31:
case 32:
case 33:
return 7;

case 28:
case 29:
return 8;
}
}

function GetWepColumn(slotid)
{
switch(slotid.tointeger())
{
case 0: return "Wep1";
case 1: return "Wep2";
case 2: return "Wep3";
case 3: return "Wep4";
case 4: return "Wep5";
case 5: return "Wep6";
case 6: return "Wep7";
case 7: return "Wep8";
case 8: return "Wep9";

default: return "Unknown";
}
}

The code ends here...

NOTE: The code is tested and if you found any bug inside the code then don't hesitate to reply to this post as it can save newbies life ;D
#3
Script Showroom / [RELEASE] Vehicle System
Jun 10, 2022, 12:03 PM
 ^-^Hi buddies, Today I'm here with a vehicle system, A simple vehicle system (bug-free).
Let me introduce to the commands these 4 commands use to add vehicles in database /addcar | /insertcar | /addveh | /insertveh
This command /removecar removes a car from the database but you must be in a car to remove the car from the database
And these 4 commands /editveh | /editcar | /updateveh | /updatecar help you to modify car data you can change the car model, world, position, colour 1 and colour 2

Put these database detail on script load event

[noae]Vehicles <- ConnectSQL("Vehicles.db");
QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Vehicles(ID NUMERIC DEFAULT 0, Model NUMERIC DEFAULT 0, World NUMERIC DEFAULT 0, Pos_X FLOAT, Pos_Y FLOAT, Pos_Z FLOAT, Angle FLOAT, Colour_1 NUMERIC DEFAULT 0, Colour_2 NUMERIC DEFAULT 0)");
LoadVehicles();
[/noae]

Commands are here just paste them into their right place

[noae]if(cmd == "addcar" || cmd == "insertcar" || cmd == "addveh" || cmd == "insertveh")
{
if(player.Name == "MR_SK") //you can edit this line as your wish
{
if(text)
{
if(player.IsSpawned)
{
local model = GetTok(text, " ", 1), world = GetTok(text, " ", 2), col1 = GetTok(text, " ", 3), col2 = GetTok(text, " ", 4);
if(model)
{
if(world)
{
if(col1)
{
if(col2)
{
model = IsNum(model) ? model.tointeger() : pGetVehicleModelFromName(model);
CreateVehicle(model.tointeger(), world.tointeger(), Vector(player.Pos.x,player.Pos.y,player.Pos.z), player.Angle, col1.tointeger(), col2.tointeger());
QuerySQL(Vehicles, "INSERT INTO Vehicles(ID, Model, World, Pos_X, Pos_Y, Pos_Z, Angle, Colour_1, Colour_2) VALUES ('"+GetVehicleCount()+"', '"+model+"', '"+world+"', '"+player.Pos.x+"', '"+player.Pos.y+"', '"+player.Pos.z+"', '"+player.Angle+"', '"+col1+"', '"+col2+"')");
MessagePlayer("[#00FF00][SUCCESS]:[#FFFFFF] Added a vehicle into database ID: "+GetVehicleCount()+", Name: "+GetVehicleNameFromModel(model)+", Model ID: "+model+"",player);
}
else ERROR("You must specify the Colour 1 for creating vehicle!",player);
}
else ERROR("You must specify the Colour 2 for creating vehicle!",player);
}
else ERROR("You must specify the world ID for creating vehicle!",player);
}
else ERROR("You must specify the model ID for creating vehicle!",player);
}
else ERROR("You must be spawned to add a car to database!",player);
}
else MessagePlayer("[#FFFF00]Syntax; /"+cmd+" <Model ID> <World ID> <Colour 1> <Colour 2>",player);
}
else ERROR("Unknown Command!",player);
}

else if(cmd == "removecar")
{
if(player.Name == "MR_SK") //you can edit this line as your wish
{
if(player.IsSpawned)
{
local veh = player.Vehicle;
if(veh)
{
if(QuerySQL(Vehicles, "SELECT * FROM Vehicles WHERE ID='"+veh.ID+"'"))
{
QuerySQL(Vehicles, "DELETE FROM Vehicles WHERE ID='"+veh.ID+"'");
MessagePlayer("[#00FF00][SUCCESS]:[#FFFFFF] Removed Vehicle ID: "+veh.ID+"",player);
veh.Delete();
UpdateVehiclesID();
ReloadVehicles();
}
else ERROR("Server was unable to find this vehicle in database!",player);
}
else ERROR("You must be in any vehicle to edit it's data!",player);
}
else ERROR("You must be spawned to add a car to database!",player);
}
else ERROR("Unknown Command!",player);
}

else if(cmd == "editveh" ||  cmd == "updateveh" || cmd == "updatecar" || cmd == "editcar")
{
if(player.Name == "MR_SK") //you can edit this line as your wish
{
if(player.IsSpawned)
{
local veh = player.Vehicle;
if(veh)
{
local model = GetTok(text, " ", 1), world = GetTok(text, " ", 2), col1 = GetTok(text, " ", 3), col2 = GetTok(text, " ", 4);
if(model)
{
if(world)
{
if(col1)
{
if(col2)
{
model = IsNum(model) ? model.tointeger() : pGetVehicleModelFromName(model);
if(QuerySQL(Vehicles, "SELECT * FROM Vehicles WHERE ID='"+veh.ID+"'"))
{
QuerySQL(Vehicles, "UPDATE Vehicles SET Model='"+model+"', World='"+world+"', Pos_X='"+veh.Pos.x+"', Pos_Y='"+veh.Pos.y+"', Pos_Z='"+veh.Pos.z+"', Angle='"+veh.Angle+"', Colour_1='"+col1+"', Colour_2='"+col2+"' WHERE ID='"+veh.ID+"'");
MessagePlayer("[#00FF00][SUCCESS]:[#FFFFFF] Vehicle Updated ID: "+veh.ID+", Name: "+GetVehicleNameFromModel(model)+", Model ID: "+model+"",player);
ReloadVehicles();
}
else ERROR("Server was unable to find this vehicle in database!",player);
}
else ERROR("You must specify the Colour 1 for creating vehicle!",player);
}
else ERROR("You must specify the Colour 2 for creating vehicle!",player);
}
else ERROR("You must specify the world ID for creating vehicle!",player);
}
else ERROR("You must specify the model ID for creating vehicle!",player);
}
else ERROR("You must be in any vehicle to edit it's data!",player);
}
else ERROR("You must be spawned to update or edit any car data!",player);
}
else ERROR("Unknown Command!",player);
}
[/noae]

And in last some functions in the vehicle system paste these functions in your script anywhere

[noae]function UpdateVehiclesID()
{
local newID = 0, q;
for(local i = 0; i < 500; ++i)
{
if(q = QuerySQL(Vehicles, "SELECT * FROM Vehicles WHERE ID='"+i+"'"))
{
newID++;
QuerySQL(Vehicles, "UPDATE Vehicles SET ID='"+newID+"' WHERE ID LIKE '"+i+"'");
}
}
}

function LoadVehicles()
{
local totalveh = 0;
for(local i = 0; i < 500; ++i)
{
local q = QuerySQL(Vehicles, "SELECT * FROM Vehicles WHERE ID='"+i+"'");
if(q)
{
CreateVehicle(GetSQLColumnData(q, 1), GetSQLColumnData(q, 2), Vector(GetSQLColumnData(q,3),GetSQLColumnData(q,4),GetSQLColumnData(q,5)), GetSQLColumnData(q,6), GetSQLColumnData(q,7), GetSQLColumnData(q,8));
totalveh+=1;
}
}
print(""+totalveh+" Vehicles has been loaded successfuly!");
}

function ReloadVehicles()
{
for(local i = 0; i < 500; ++i)
{
local veh = FindVehicle(i);
if(veh)
{
veh.Delete();
}
}
LoadVehicles();
}

function ERROR(string, player)
{
MessagePlayer("[#FF0000][ERROR]: "+string,player);
}

function pGetVehicleModelFromName(model)
{
model = model.tolower();
if(model.find("hydra") != null) return 6420; //you can continue with adding more line to this functions if you've more custom vehicles just change the vehicle name and model ID

else{
return GetVehicleModelFromName(model);
}
}

function GetTok(string, separator, n, ...)
{
 local m = vargv.len() > 0 ? vargv[0] : n,
    tokenized = split(string, separator),
    text = "";
 
 if (n > tokenized.len() || n < 1) return null;
 for (; n <= m; n++)
 {
  text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
 }
 return text;
}
[/noae]

The code is tested yet and no bug was found if you found any bug in this code then don't hesitate to reply to this post as it can save newbies time :P
#4
Script Showroom / [RELEASE] Temp Ban System
Jun 10, 2022, 11:27 AM
Hi buddies, I've been taking a look in VC: MP community and I was unable to find the Temp Ban system, if I got some then it was old or not working properly so I decided to make my own Temp Ban System Here's the code:

Put these database detail on script load event

[noae]TempBans <- ConnectSQL("TempBans.db");
QuerySQL( TempBans, "CREATE TABLE IF NOT EXISTS TempBans( Name TEXT, UID TEXT, UID2 TEXT, IP FLOAT, Time NUMERIC, ExpireTime NUMERIC, TimeExpireRatio TEXT, Admin TEXT, Reason TEXT )" );
[/noae]

Don't forget to put this line on player join event

[noae]CheckTempBan(player);[/noae]

Commands are here You just have to paste them on player command event

[noae]if(cmd == "tempban")
{
if(text)
{
local plr = GetPlayer(GetTok(text, " ", 1)), expire = GetTok(text, " ", 2), reason = GetTok( text, " ", 3, NumTok( text, " " ) );
if(plr)
{
if(expire)
{
if(reason)
{
local ban_expire = split(expire, ":");
if(NumTok(expire, ":") == 3)
{
if(IsNum(ban_expire[0]) && IsNum(ban_expire[1]) && IsNum(ban_expire[2]))
{
local calc = ((ban_expire[ 0 ].tointeger()*24*60*60) + (ban_expire[ 1 ].tointeger()*60*60) + (ban_expire[ 2 ].tointeger()*60));
QuerySQL( TempBans, "INSERT INTO TempBans( Name, UID, UID2, IP, Time, ExpireTime, TimeExpireRatio, Admin, Reason ) VALUES ('"+plr.Name+"', '"+plr.UniqueID +"', '"+plr.UniqueID2+"', '"+plr.IP.tofloat()+"', '"+time()+"', '"+calc+"', '"+expire+"', '"+player.Name+"', '"+reason+"')");
Message("[#FF0000][PRIOR BAN]: [#FFFFFF]"+plr.Name+" is banned for Reason: "+reason+", TimeLeft: " + GetBanRemainingTime(time().tointeger(), expire.tostring())+", Admin: "+player.Name+"");
plr.Kick();
}
else MessagePlayer("[#FF0000][ERROR]: You've entered wrong values in the time, make sure you have entered numbers only!",player);
}
else MessagePlayer("[#FF0000][ERROR]: Time Format must be DAYS:HOURS:MINUTES!",player);
}
else MessagePlayer("[#FF0000][ERROR]: You must specify a reason to ban requested player!",player);
}
else MessagePlayer("[#FF0000][ERROR]: Please type the duration of the ban for the requested player!",player);
}
else MessagePlayer("[#FF0000][ERROR]: Unknown player!",player);
}
else MessagePlayer("[#FFFF00]Syntax; /tempban <player/ID> <Days:Hours:Minutes> <Reason>",player);
}

else if(cmd == "untempban")
{
if(text)
{
local plrname = GetTok(text, " ", 1);
local q = QuerySQL(TempBans, "SELECT * FROM TempBans WHERE LOWER(Name)='"+plrname.tolower()+"'");
if(q)
{
QuerySQL(TempBans, "DELETE FROM TempBans WHERE LOWER(Name)='"+plrname.tolower()+"'" );
MessagePlayer("[#00FF00][SUCCESS]: [#FFFFFF]The user: "+GetSQLColumnData(q,0)+" has been unbanned!",player);
}
else MessagePlayer("[#FF0000][ERROR]: Can't found this nickname: "+plrname+" in database!",player);
}
else MessagePlayer("[#FFFF00]Syntax; /untempban <player full name>",player);
}
[/noae]


And in Last there are some important functions paste them to anywhere in your script

[noae]function CheckTempBan(player)
{
local q = QuerySQL( TempBans, "SELECT * FROM TempBans WHERE UID='"+escapeSQLString(player.UniqueID)+"' OR UID2='"+escapeSQLString(player.UniqueID2)+"'" );
if(q)
{
if((time() - GetSQLColumnData( q, 4 ).tointeger()) >= GetSQLColumnData( q, 5 ).tointeger())
{
QuerySQL(TempBans, "DELETE FROM TempBans WHERE LOWER(Name)='" + player.Name.tolower() + "'" );
}
else
{
Message("[#FF0000][PRIOR BAN]: [#FFFFFF]"+player.Name+" is banned for Reason: "+GetSQLColumnData(q, 8)+", TimeLeft: "+GetBanRemainingTime(GetSQLColumnData( q, 4 ).tointeger(), GetSQLColumnData( q, 6 ).tostring())+", Admin: "+GetSQLColumnData(q, 7)+"");
player.Kick();
}
FreeSQLQuery( q );
}
}

function GetBanRemainingTime( bantime,  banratio )
{
  local ban_current = time()-bantime;
  local total_time = "";
  local sp = split(banratio,":");
  local ban_Days = 0, ban_Hours = 0, ban_Minutes = 0;
  local ban_Day = sp[ 0 ].tointeger();
  local ban_Hour = sp[ 1 ].tointeger();
  local ban_Minute = sp[ 2 ].tointeger();
  ban_Days = ban_current/86400;
  ban_current = ban_current%86400;
  ban_Hours = ban_current/3600;
  ban_current = ban_current%3600;
  ban_Minutes = ban_current/60;
  ban_current = ban_current%60;
  ban_Day -= ban_Days;
  ban_Hour -= ban_Hours;
  ban_Minute -= ban_Minutes;
  local mints_to_hour = ban_Minute / 60;
  ban_Minute = ban_Minute - (mints_to_hour * 60);
  ban_Hour += mints_to_hour;
  local hours_to_days = ban_Hour / 24;
  ban_Hour = ban_Hour - (hours_to_days * 24);
  ban_Day += hours_to_days;
  local months = ban_Day / 31;
  ban_Day = ban_Day - (months * 31);
  local weeks = ban_Day / 7;
  ban_Day = ban_Day - (weeks * 7);
  local years = months / 12;
  months = months - (years * 12);
  if(years > 0) total_time += ", "+years+" Years";
  if(months > 0){if(total_time != ""){total_time += ", "+months+" Months";}else{total_time += months+" Months";}}
  if(weeks > 0){if(total_time != ""){total_time += ", "+weeks+" Weeks";}else{total_time += weeks+" Weeks";}}
  if(ban_Day > 0){if(total_time != ""){total_time += ", "+ban_Day+" Days";}else{total_time += ban_Day+" Days";}}
  if(ban_Hour > 0){if(total_time != ""){total_time += ", "+ban_Hour+" Hours";}else{total_time += ban_Hour+" Hours";}}
  if(ban_Minute > 0){if(total_time != ""){total_time += ", "+ban_Minute+" Minutes";}else{total_time += ban_Minute+" Minutes";}}
  return total_time;
}

function GetTok(string, separator, n, ...)
{
 local m = vargv.len() > 0 ? vargv[0] : n,
    tokenized = split(string, separator),
    text = "";
 
 if (n > tokenized.len() || n < 1) return null;
 for (; n <= m; n++)
 {
  text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
 }
 return text;
}

function GetPlayer( plr )
{
    if ( plr )
    {
        if ( IsNum( plr ) )
        {
            plr = FindPlayer( plr.tointeger() );
            if ( plr ) return plr;
            else return false;
        }
    else
        {     
            plr = FindPlayer( plr );
            if ( plr ) return plr;
            else return false;
        }
    }
    else return false;
}

function NumTok(string, separator)
{
 local tokenized = split(string, separator);
 return tokenized.len();
}
[/noae]

The code is tested and works properly fine if you find any bug then forgive me :P and don't hesitate to reply to this post as it can save others time to kill the bug

NOTE: I've just used Rocky's Temp Ban Calculations :P and other stuff of ban system is made by me
#5
General Discussion / Re: About radio stations
Jun 05, 2022, 02:09 PM
Quote from: habi on Jun 05, 2022, 07:54 AMThere are a couple songs while inside vehicle. They are in a local language. I'm hearing it again and again all the time.

I checked mp3 folder inside Gta vice city and found nothing.

My question is if i'm with a friend and we are both in a vehicle, is he hearing the same music as me?

Hi habi, probaly no lol because he must add the same music with your one in his Vice City Folder so you've to create radios for VCMP idk how to do it lel.

P.S: You've updated your forum pfp ;D.
#6
Community Plugins / Re: Discord Plugin
Jun 04, 2022, 06:19 AM
Quote from: Hendrix on Jun 03, 2022, 12:58 PMI'm having problems loading the plugin
Loaded plugin: xmlconf04rel64

Loaded plugin: sqlite04rel64

Loaded plugin: squirrel04rel64

Loaded plugin: hashing04rel64

Loaded plugin: geoip04rel64

Loaded plugin: sockets04rel64

Loaded plugin: announce04rel64

Plugin error >> LoadLibrary() 'plugins/discord04rel64.dll' failed: Code 126
Failed to load plugin: discord04rel64

** Started VC:MP 0.4 Server **
 Port: 8192
 Max players: 100

[MODULE]  Loaded server.conf Loader for 0.4 by Stormeus
[MODULE]     >> Loaded server.conf for parsing
[MODULE]     >> Applied settings
[MODULE]     >> Loaded classes
[MODULE]     >> Loaded vehicles
[MODULE]     >> Loaded pickups
[MODULE]  Loaded server.conf successfully

[MODULE]  Loaded SQLite3 for VC:MP by Stormeus.

[MODULE]  Loaded SqVCMP 0.4 frontend by Stormeus. (v1.0)
[SCRIPT]  |------------------------------|
[SCRIPT]  | Server                       |
[SCRIPT]  | Made by Mack                 |
[SCRIPT]  |------------------------------|
[SCRIPT]  Vehiculos cargados: 0
[SCRIPT]  Config Loaded
[SCRIPT]  Total vehicles loaded: 221
[SCRIPT]  VEHICLES LOADED: 221
[SCRIPT]  [Loaded] Alias - 11242
[SCRIPT]  Pickups Loaded - 0
[SCRIPT]  Confirming echo bot details...
[SCRIPT]  Bot details confirmed!
[MODULE]  Loaded GeoIP for 0.4 by Crys.
            >> Loaded GeoIP.dat (GeoIP Country Edition)

[MODULE]  Loaded sq_sockets for VC:MP by the LU Dev Team (ported by Stormeus).
announcer: Ready to announce to masterlist(s)
[SCRIPT]  Attempting to set user, nick and mode....
[SCRIPT]  Task completed successfully.





and already install Win64OpenSSL_Light-3_0_3 and Win64OpenSSL-3_0_3 the full my operating system is x64
Hi bro, instead of 3_0_3 you should install 1_0_1 the old version because i faced that problem too
#7
Hey sonmez, how you have disabled the old chat box? i mean there wasn't showing any text of old box
#8
Quote from: habi on Apr 14, 2022, 12:55 PMnice package.

So may i ask a question or two about its usage. My understanding is that anyplayer in the server can 'create' a class, team and save it.

Btw, i saw a 500x for-loop in the code.

Also i was wondering every scripter who posts snippets creating an account in github or bitbucket so that others can inspect it, create a pull request.

Ah! I got something in my mind..



Not any and also not 500x loops xd the scripts somethings designed like this that if any classs table is opened then a new class table can't be open you have to close it first and it's like doom killer's map editor and it won't be bugged :/
#9
Hi, today I am going to show you the in-game class editor(AKA Skins on spawn screen).
Classes are the most important things of server we why wouldn't make it cool and easily
Don't waste your time on making class manually just use this snippet ;D
I've been working since yesterday on class editor the controls are pretty simple you just have to follow me
Download this rar file and paste the whole content into the server main directory



How to use it?:

You just have to create a class table by using /newclass <Class Table Name>
If you already have made a project then you have to use /loadclass <The Table Name That You Have Made Already>
Then You can add classes by this command /addclass <Team ID> <Skin ID> <R> <G> <B> <Weapon 1> <Weapon 2> <Weapon 3> the command have 8 params the Param Team ID Defines the team id of class and the skin ID defines The Skin(AKA Player Model) The R G B Colour codes defines player colour nametag chat colour etc and the last 3 params are the weapon of class which will be given to the player when he spawns you have to give the weapon Name Or ID. You can also delete class for example you've created an class and you want to delete it then use /deleteclass2 if you want to delete a specific one then use /deleteclass <Skin ID> and then after all adding all classes you have to use /exportclass then it will export the classes code to scripts/Exported_Classes/ folder it will create the file from the class project name and all the id you can get from here:

Weapons IDs: http://wiki.thijn.ovh/index.php?title=Weapons
Skins IDs: http://wiki.thijn.ovh/index.php?title=Skins
RGB Colour codes: https://www.rapidtables.com/web/color/RGB_Color.html
You can also make the rgb colours through the given website link

The code is tested if any errors occured then feel free to reply on this topic
#10
Quote from: habi on Apr 12, 2022, 05:44 PMHi i was just making a highlighter for notepad++.



Yes this highlights and autocompletes function and events.

I have not added, the usual functions like print, fget, format etc yet.

Installation
Download the files from my github https://github.com/habi498/VCMPSqNpp

Put 'Vice City Multiplayer Server.udl.xml' in  % appdata % \ Notepad++ \ userDefineLangs
Put 'Vice City Multiplayer.xml' in C:\ Program Files \ Notepad++ \ autoCompletion
Restart Notepad++. Any files ending with '.nut' will be automatically highlighted. If not, select 'Vice City Multiplayer' from 'Language' Menu. (It is on bottom most )
[spoiler][/spoiler]
You can select highlight colours of your own by Language->User Defined Language->Define your language.. Then select "Vice City Multiplayer". (After editing just close the window, it will be saved automatically)

If you are interested, or want to contribute let me know. (or github - a pull request !)

Credits: samisalreadytaken@github for basic squirrel language highlighter, habi for function and event definitions

Hey which version you are using because i don't find the both folder that you told in installation :/
#11
Off-Topic General / Re: Need a plugin
Mar 17, 2022, 06:11 PM
Quote from: habi on Mar 14, 2022, 03:15 PMi got P.M and you mentioned the issue was fixed somehow.
Hi. i hope you are doing well i have sent you a pm but i think you have noticed on it please take a look on it
#12
Off-Topic General / Re: Need a plugin
Mar 13, 2022, 03:31 PM
Quote from: habi on Mar 13, 2022, 03:20 PMSomewhere in the script, like top of the script or onScriptLoad. It will print all files in the directory.

Also you can replace function delete_file with this if you want.
function delete_file(file)
{
 local cmd="rm "+file;
 system(cmd);
}

hey this thing is behaving weird

rm: cannot remove '1.txt': No such file or directory
rm: cannot remove 'output.txt': No such file or directory
rm: cannot remove 'query.txt': No such file or directory
GeoIP.dat                          database
announce.log                       delfile
archive-2022-03-09T134053Z.tar.gz  mpsvrrel64
archive-2022-03-09T134215Z.tar.gz  plugins
archive-2022-03-11T031426Z.tar.gz  scripts
archive-2022-03-13T134804Z.tar.gz  server.cfg
archive-2022-03-13T135017Z.tar.gz  server.conf
archive-2022-03-13T152919Z.tar.gz  server_log.txt
call_curl                          store
curl[/connect]


and this happend on checking if the mail is valid
[SCRIPT] Fetching Next UID from Gmail...
rm: cannot remove 'query.txt': No such file or directory
nohup: appending output to 'nohup.out'
[SCRIPT] UID = 14
[SCRIPT] Sending test email and waiting 15 seconds..
rm: cannot remove 'mail.txt': No such file or directory
nohup: appending output to 'nohup.out'
[SCRIPT] Checking for New mail from google
rm: cannot remove 'output.txt': No such file or directory
nohup: appending output to 'nohup.out'
nohup: failed to run command './call_curl': No such file or directory
[SCRIPT] call_curl did not finished after 20 seconds
#13
Off-Topic General / Re: Need a plugin
Mar 13, 2022, 03:13 PM
Quote from: habi on Mar 13, 2022, 02:49 PMTry
system("dir");

where to use it? i mean where to paste it in the script?
#14
Off-Topic General / Re: Need a plugin
Mar 13, 2022, 01:46 PM
Quote from: habi on Mar 13, 2022, 09:23 AMThat was because, the second version we made above(i.e. reading email with imap) was not made usable for linux.
For linux, the code goes here. (Working, i tested it)
gmail_linux.nut
[noae][noae]/*First you need to go here and allow unsecure apps
https://www.google.com/settings/security/lesssecureapps */

/*function:ReadTextFromFile, Credits: SLC https://forum.vc-mp.org/?topic=6116.msg42113#msg42113*/
function ReadTextFromFile(path)
{
    local f = file(path,"rb"), s = "";

    while (!f.eos())
    {
        s += format(@"%c", f.readn('b'));
    }

    f.close();

    return s;
}

function SendEmailFromGmailAccount(from,password,to,subject,message)
{
delete_file("mail.txt")
local myfile = file("mail.txt","wb+");
myfile.seek(0,'e');
local text="From: <"+from+">\r\nTo: <"+to+">\r\nSubject: "+subject+"\r\n\r\n"+message+"\r\n";
foreach(c in text)
{
 myfile.writen(c,'b');
}
myfile.close();
local cmd="nohup ./curl smtps://smtp.gmail.com:465 -v --mail-from "+from+" --mail-rcpt "+to+" --ssl -u "+from+":"+password+" -T "+"mail.txt"+" -k --anyauth &>/dev/null &";
//print(cmd);
system(cmd);
}
function delete_file(file)
{
local cmd="./delfile "+file;
system(cmd);
}
function IMAPFREE()
{
delete_file("1.txt");
delete_file("output.txt");
delete_file("query.txt");
}
function IMAPEXIT()
{
IMAPFREE();
}
function IMAPINIT(from, password)
{
IMAPFREE();
mUID<-0;//the message number. 1 for the first message (very old)
imapEmail<-from;ipass<-password
//updateUID();
generator<-null;
}

function updateUID(...)
{
mUID=0;//Reset UID
local from=imapEmail;local password=ipass;
delete_file("query.txt");
local cmd="nohup ./curl --url imaps://imap.gmail.com:993/INBOX/ -u "+from+":"+password+ " -X \"EXAMINE INBOX\" -o query.txt &>/dev/null &";
system(cmd);
local flag;
if(vargv.len()==0)
 flag=0;
else flag=vargv[0];
qTimer <- NewTimer("mMyTimer", 1000, 11,GetTickCount(),flag);
}
function mMyTimer(oTickcount,flag)
{
 local i=IsFileExists("query.txt");
 if(!i)
 {
  if(GetTickCount()>=(oTickcount+10000))
  {
   print("Fetching UID Failed. Aborting..");
   qTimer.Delete();
  }
  return;
 }
 local text=ReadTextFromFile("query.txt");
 local r=text.find("[UIDNEXT ");
 if(!r){
 if(GetTickCount()>=(oTickcount+10000))
  print("program failed\n");qTimer.Delete();
 return;
 }
 local s=text.find("]",r+1);
 local UID=text.slice(r+9,s);
 qTimer.Delete();
 mUID<-UID;
 print("UID = "+mUID);
 if(flag==true && generator)
 {
  try {
   print("Sending test email and waiting 15 seconds..");
   resume generator;
   if(generator.getstatus()!="dead")resume generator;
  }catch(e){
   print(e);
  }
 }
}
function IsValidEmailAddress(email,subject,message,param)
{
 if(imapEmail==email)
 {
  print("You cannot use your own email to check");
  return;
 }
 print("Fetching Next UID from Gmail...");
 updateUID(true);
 generator=__IsValidEmailAddress(email,subject,message,param)
}
function __IsValidEmailAddress(email,subject,message,param)
{
 yield _IsValidEmailAddress(email,subject,message,param);
}
function _IsValidEmailAddress(email,subject,message,param)
{
 if(mUID==0){print("Program not ready!");return;}
 /*if(imapEmail==email)
 {
  print("You cannot use your own email to check");
  return;
 }*/
 SendEmailFromGmailAccount(imapEmail,ipass,email,subject,message);
 //Wait for Email to be send.
 qTimer2<-NewTimer("CheckGmailInbox",15000,1,email,param);//10 seconds
}

//Check Gmail Inbox
function CheckGmailInbox(email,p)//email to be tested
{
 print("Checking for New mail from google");
 ReadEmailFromGmailAccountInbox(imapEmail,ipass,mUID,email,"Address not found",p);
}


//The following function reads Gmail Inbox for message number UID.
//If such a message number exists, it reads the message and checks if the message contains both parameter p1 and p2.
//If true, then it calls onReadSucessMatchFound with parameters p1,p2 and p3.
//Otherwise, it calls onReadSucessMatchNotFound with parameters p1,p2 and p3.
//If such a message number not exists, it calls onReadFromUIDFailed with parameter UID, p1,p2 and p3.
function ReadEmailFromGmailAccountInbox(from, password,UID, p1,p2,p3)//p1=email to be tested, p2="Address not found", p3="player name"
{
delete_file("output.txt");
local cmd="nohup ./call_curl curl --url \"imaps://imap.gmail.com:993/INBOX;UID="+UID+"\" --user "+from+":"+password+"  -o output.txt &>/dev/null &";
//print(cmd);
system(cmd);
qTimer3<-NewTimer("CheckCurlReadEmailFinish",1000,0,GetTickCount(),UID,p1,p2,p3);
}
//The following function is called every second by the caller
//and the function checks if the process started by the caller
//is finished. It aborts after 20 seconds, anyway.
function CheckCurlReadEmailFinish(oTickcount,UID,p1,p2,p3)
{
 if(IsFileExists("1.txt"))
 {
  print("Read Email with UID completed. Checking Success..");
  onCurlReadEmailFinish(UID,p1,p2,p3);qTimer3.Delete();}
 else if(GetTickCount()>oTickcount+20000)//20 seconds waited. Then abort.
 {
  qTimer3.Delete();
  print("call_curl did not finished after 20 seconds");
 }
}
function IsFileExists(filename)
{
 local f;
 try{f=file(filename,"rb");}
 catch(e){return 0;}
 return 1;
}
function onCurlReadEmailFinish(UID,p1,p2,p3)
{
 qTimer2.Delete();
 local i=IsFileExists("output.txt");
 if(!i){onReadFromUIDFailed(UID,p1,p2,p3);return;};
 
 //A message arrived. What is it?
 local text=ReadTextFromFile("output.txt");
 
 if(text.find(p1) && text.find(p2))
 {
  onReadSucessMatchFound(p1,p2,p3);
 }else onReadSucessMatchNotFound(p1,p2,p3);
 return; 
}
function onReadFromUIDFailed(UID,p1,p2,p3)
{
 if(UID && p2=="Address not found")//This means we are checking for "Address not found"
  print("Google's Invalid Email Report not arrived");//No new mail arrived in inbox (UID invalid) //So given email can be correct.
}
function onReadSucessMatchFound(p1,p2,p3)
{
 if(p2=="Address not found")
  {
   print("Google reported that email "+p1+" is invalid!");
   local idx=[0];
   local plrid=strtok2(p3,idx);
   local s=strtok2(p3,idx);
   if(s=="Register_Account")
    print("Kicking "+plrid+" while registering an account");
  }
}
function onReadSucessMatchFound(p1,p2,p3)
{
 if(p2=="Address not found")
  {
   print("Google reported that email "+p1+" is invalid!");
   print("Kick "+p3);
  }
}
/*strtok2 modified from Zeex strtok function sa-mp*/
function strtok2(string,array)
{
 local index=array[0];
 local length=string.len();
 /* Skip the leading white space */
 while(index<length && string[index]<=' ')
  index++;
 local result="";
 local offset = index;
 while( index < length && string[index] > ' ' && index-offset < 20-1)
 {
  result+=string.slice(index,index+1);
  index++;
 }
 array[0]=index;
 return result;
}
[/noae][/noae]

On server folder, you need to have
delfile
[noae][noae]#!/bin/bash
FILE=$1; if [[ -f "$FILE" ]]; then rm "$FILE"; fi;
[/noae][/noae]
call_curl
[noae][noae]#!/bin/bash
FILE=1.txt;if [[ -f $FILE ]]; then rm $FILE; fi
$@
>1.txt
exit
[/noae][/noae]

The above two files should have unix type line endings. I use notepad++ and there is an option Windows(CR LF) in bottom. Right click and select UNIX(LF). Otherwise it throw error on squirrel.
Note that the two files also do not have extensions like .txt or anything.
One last thing is that you have to give chmod 777 delfile and chmod 777 call_curl

So if you install these files on server folder, then you are ready to go
dofile("gmail_linux.nut");
IMAPINIT("[email protected]","your_password");
local password="xyz"; //Player account password on your system.
IsValidEmailAddress("[email protected]","Welcome","This is send to verify your email",5+" "+"Register_Account"+" "+password);//Replace 5 by player ID.

PS: Ah make those changes to the functions onReadFromUIDFailed(UID,p1,p2,p3), onReadSucessMatchNotFound(p1,p2,p3), onReadSucessMatchFound(p1,p2,p3) and add functions onInvalidEmailNotDetected, AllowPlayerToRegister which were customized for the need you mentioned.

ciao

Hi, i hope you are doin well, buddy i got those errors :/ it asked that the delfile and call_curl doesn't exist in panel but i have it also i have set its permit to 777

[SCRIPT] Fetching Next UID from Gmail...
sh: 1: ./delfile: not found
nohup: appending output to 'nohup.out'
[SCRIPT] UID = 13
[SCRIPT] Sending test email and waiting 15 seconds..
sh: 1: ./delfile: not found
nohup: appending output to 'nohup.out'
[SCRIPT] Checking for New mail from google
sh: 1: ./delfile: not found
nohup: appending output to 'nohup.out'
nohup: failed to run command './call_curl': No such file or directory
[SCRIPT] call_curl did not finished after 20 seconds

#15
Off-Topic General / Re: Need a plugin
Mar 12, 2022, 03:22 PM
Hi habi i got this error in my system can you check my gmail.nut i just modify it a little bit i have sent you the file in Forums pm

[SCRIPT] Fetching Next UID from Gmail...
sh: 1: Syntax error: end of file unexpected (expecting "then")
sh: 1: start: not found
[SCRIPT] Fetching UID Failed. Aborting..
[SCRIPT] Fetching Next UID from Gmail...
sh: 1: Syntax error: end of file unexpected (expecting "then")
sh: 1: start: not found
[SCRIPT] Fetching UID Failed. Aborting..
[SCRIPT] Fetching Next UID from Gmail...
sh: 1: Syntax error: end of file unexpected (expecting "then")
sh: 1: start: not found