Quote from: Doom_Kill3R on Mar 17, 2019, 05:30 AMYou can't pass player instances in timers, it crashes the server, pass player ID and and find the player on callback functionThat's was one of my problems when i made Anti-Spawnkill.
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 MenuQuote from: Doom_Kill3R on Mar 17, 2019, 05:30 AMYou can't pass player instances in timers, it crashes the server, pass player ID and and find the player on callback functionThat's was one of my problems when i made Anti-Spawnkill.
Quote from: Doom_Kill3R on Feb 26, 2019, 06:00 PMhttps://forum.vc-mp.org/?topic=3364.0
?
Quote from: Athanatos on Feb 26, 2019, 05:52 PMshort and simple.And, giving tutorials...
Quote from: Dominio on Feb 08, 2019, 01:00 AMBy the way, check the web, but I find that many are only SA, is not practically VC.The only difference between SA and VC is in the bones, So you must know VC bones and SA bones, in the site it's SA's skin tutorial, open any VC skin with your 3DSMax and see the different.
Quote from: Athanatos on Jan 21, 2019, 03:43 PMNo shit sherlock, he just made a few cmds, and that's it, he's the best scripter over there.Hey Athanatos, he was a newbie, we was telling him to make the scripts with himself, and he was asking us a lot.
Quote from: Mohamed on Jul 23, 2018, 09:15 PMGooD JoB, You are now best.There's a different in Best and The Best, you surely know it, so you used it here.
Quote from: Athanatos on Jan 21, 2019, 03:43 PMhe's the best scripter over there.Finally, Your zombie server is cool i saw it.
function onScriptLoad()
{
Stats <- array(GetMaxPlayers(), null);
Lastpos <- ConnectSQL( "MT-LastVectors.db" );
QuerySQL( Lastpos, "CREATE TABLE IF NOT EXISTS Locations ( Name VARCHAR(32), LastPosX VARCHAR(25), LastPosY VARCHAR(25), LastPosZ VARCHAR(25), LastPos TEXT )" );
}
function onPlayerSpawn(player)
{
if ( player.World == 1 )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if( q && GetSQLColumnData(q, 4) == "on" )
{
local Y = GetSQLColumnData(q, 2).tointeger(),
X = GetSQLColumnData(q, 1).tointeger(),
Z = GetSQLColumnData(q, 3).tointeger();
player.Pos = Vector( X, Y, Z);
MessagePlayer("You has been landed in your last location.", player);
}
}
}
function onPlayerCommand( player, cmd, text )
{
if(cmd == "lastpos")
{
if(!text) MessagePlayer("[#ff0000]/" + cmd + " <on/off>", player);
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) QuerySQL(Lastpos, "INSERT INTO Locations ( Name, LastPosX, LastPosY, LastPosZ, Lastpos ) VALUES ( '" + player.Name + "', '0' , '0' , '0','null' ) ");
else
{
if(text == "on")
{
QuerySQL(Lastpos, "UPDATE Locations SET Lastpos = 'on' WHERE Name = '" + player.Name + "'");
Announce( "~t~Lastpos Enabled", player , 0 );
}
if(text == "off")
{
QuerySQL(Lastpos, "UPDATE Accounts SET Lastpos = 'off' WHERE Name = '" + player.Name + "'");
Announce( "~y~Lastpos Disabled", player , 0 );
}
}
}
}
function onPlayerPart( player, reason )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) return 0;
else{
QuerySQL(Lastpos, "UPDATE Locations SET LastPosX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
}
}
function onPlayerKill( killer, player, reason, bodypart )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) return 0;
else{
QuerySQL(Lastpos, "UPDATE Locations SET LastPosX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
}
}
function onPlayerDeath( player, reason )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) return 0;
else{
QuerySQL(Lastpos, "UPDATE Locations SET LastPosX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
}
}
Quote from: Mahmoud Tornado on May 10, 2018, 11:24 PMI don't have warchief Script.
Quote from: =RK=MarineForce on Oct 06, 2018, 07:25 PMHey, Bro how to use GetSQLColumnCount <- SQLite_ColumnCount;
GetSQLColumnData <- SQLite_ColumnData;
i don't understand , Xd
ConnectSQL <- SQLite_Open;
DisconnectSQL <- SQLite_Close;
QuerySQL <- SQLite_Query;
GetSQLNextRow <- SQLite_NextRow;
FreeSQLQuery <- SQLite_Release;
escapeSQLString <- SQLite_Escape;
Quote from: KuRuMi^ on Sep 22, 2018, 06:57 AM[noae][/noae]Quote from: =RK=MarineForce on Sep 21, 2018, 01:53 PM[/noae]class PlayerStats
its not save the data when i quit. Commands Made by =TRC=Kelvin. i can but i need to know about steps.
{
login = false;
register = false;
}
function onScriptLoad()
{
db <- ConnectSQL( "DataBase.db" );
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Stats ( Name VARCHAR(32), IP VARCHAR(25), Admin TEXT, Reason TEXT )" );
database<- ConnectSQL( "database.db" );
QuerySQL( database, "CREATE TABLE IF NOT EXISTS Stats ( player VARCHAR(255), password VARCHAR(255), uid VARCHAR(255) " );
Stats <- array(GetMaxPlayers(), null);
print("Register,Login System Has Been Loaded by MarineForce");
}
function onScriptUnload()
{
DisconnectSQL( db );
DisconnectSQL( database );
}
function onPlayerJoin( player )
{
Stats[player.ID] = PlayerStats();
Message(" " + player.Name + " Has Joined The server : " + player.IP + " ");
}
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "register" )
{
if ( ( Stats[ player.ID ].register ) || ( Stats[ player.ID ].login ) ) PrivMessage( player, "Error: You are already registered." );
else if ( !text ) PrivMessage( player, format( "Error: Use /%s <password>", cmd ) );
else
{
QuerySQL( database, "INSERT INTO Stats ( player, password, uid) VALUES ( '" + player.Name.tolower() + "', '" + SHA256( text ) + "', '" + player.UniqueID + "', '0', '0', '0', '1', '0', '1', 'on' )" );
Stats[player.ID].register = true;
Stats[player.ID].login = true;
PrivMessage( player, format( "You have been successfully registered! Nickname:[ %s ] Password:[ %s ]", player.Name, text ) );
MessageAllExcept( format( "[#00FF00]>> %s has been successfully registered.", player.Name ), player );
}
}
else if ( cmd == "login" )
{
if ( Stats[ player.ID ].login ) PrivMessage( player, "Error: You are already logged-in." );
else if ( !text ) PrivMessage( player, format( "Error: Use /%s <password>", cmd ) );
else if ( SHA256( text ) != GetSQLColumnData( QuerySQL( database, "SELECT password FROM Stats WHERE player = '" + player.Name.tolower() + "'" ), 0 ) ) PrivMessage( player, "INVALID PASSWORD." );
else
{
local query = QuerySQL( database, "SELECT * FROM Stats WHERE player = '" + player.Name.tolower() + "'" );
if ( query )
{
Stats[player.ID].register = true;
Stats[player.ID].login = true;
Message(" Welcome Back To Server " + player.Name + " ");
}
else PrivMessage( player, "wtf" );
}
}
}
///if i learn this thing i hope i will make my own Account System
///Some Things From Kelvin aCCOUNT system which i don't understand its only in cmd
Can u tell me, how to use it and what is . it//what is GetSQLColumnData ??? and tolower
' + player.Name.tolower()+"' "); what it Tolower?
I know QuerySQL( database, "SELECT password FROM Stats WHERE player = ' " +
//else if ( SHA256( text ) != GetSQLColumnData( QuerySQL( database, "SELECT password FROM account WHERE player = '" + player.Name.tolower() + "'" ), 0 ) ) PrivMessage( player, "INVALID PASSWORD." );
// QuerySQL( database, "INSERT INTO Stats ( player, password, uid)
// VALUES ( '" + player.Name.tolower() + "', '" + SHA256( text ) + "', '" + player.UniqueID + "', '0', '0', '0', '1', '0', '1', 'on' )" );
Haven't you written a code where it'll update the player's statistics into the database on the onPlayerPart event?
else if ( cmd == "setlevel" )
{
if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Level>", player );
else
{
local
plr = GetPlayer( GetTok( text, " ", 1 ) ),
lvl = GetTok( text, " ", 2);
if ( !plr ) MessagePlayer( "Unknown Player..", player );
else if ( !lvl ) MessagePlayer("You must put a level.", player);
else if ( !IsNum( lvl ) ) MessagePlayer("Level must be in numbers.", player);
else
{
Stats[ plr.ID ].Level = lvl.tointeger();
QuerySQL( db,"UPDATE Database SET Level='"+lvl+"' WHERE lower(Name) LIKE '"+plr.Name+"'");
Message("Administration Command: Admin "+player.Name+" Has Set level of "+plr.Name+" to: "+lvl+".");
}
}
}
if ( cmd == "setlevel" )
{
if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Level>", player );
else
{
local
plr = GetPlayer( GetTok( text, " ", 1 ) ),
lvl = GetTok( text, " ", 2),
if ( !plr ) MessagePlayer( "Unknown Player..", player );
else if ( !lvl ) MessagePlayer("You must put a level.", player);
else if ( !IsNum( lvl ) ) MessagePlayer("Level must be in numbers.", player);
else
{
local q = QuerySQL(Admindb, "SELECT * FROM Admins WHERE Name = '" + escapeSQLString(plr.Name) + "'");
if (!q) QuerySQL( DataBase, "INSERT INTO Accounts ( Name, LowerName, Level ) VALUES ( '" + escapeSQLString(plr.Name) + "','" + escapeSQLString(plr.Name) + "','" + 0 + "')" );
else
{
Stats[ plr.ID ].Level = lvl.tointeger();
QuerySQL( Admindb, "UPDATE Admins SET Level='"+lvl+"' WHERE Name LIKE '" + plr.Name + "'" );
Message("Administration Command: Admin "+player.Name+" Has Set "+plr.Name+" As an admin level: "+lvl+".");
}
}
}
}
Quote from: Humzasajjad on Sep 20, 2018, 11:49 AMQuerySQL(db, "create table if not exists Database ( Name TEXT, LowerName TEXT, Password VARCHAR(255), Level NUMERIC DEFAULT 1, IP VARCHAR(255) ");This is the first system, this is a addition to accounts system.
Quote from: Humzasajjad on Sep 20, 2018, 11:49 AMif ( cmd == "setlevel" )So it must get error.
{
if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Level>", player );
else
{
local
plr = GetPlayer( GetTok( text, " ", 1 ) ),
lvl = GetTok( text, " ", 2),
if ( !plr ) MessagePlayer( "Unknown Player..", player );
else if ( !lvl ) MessagePlayer("You must put a level.", player);
else if ( !IsNum( lvl ) ) MessagePlayer("Level must be in numbers.", player);
else
{
local q = QuerySQL(Admindb, "SELECT * FROM Admins WHERE Name = '" + escapeSQLString(plr.Name) + "'");
if (!q) QuerySQL( DataBase, "INSERT INTO Accounts ( Name, LowerName, Level ) VALUES ( '" + escapeSQLString(plr.Name) + "','" + escapeSQLString(plr.Name) + "','" + 0 + "')" );
else
{
Stats[ plr.ID ].Level = lvl.tointeger();
QuerySQL( Admindb, "UPDATE Admins SET Level='"+lvl+"' WHERE Name LIKE '" + plr.Name + "'" );
Message("Administration Command: Admin "+player.Name+" Has Set "+plr.Name+" As an admin level: "+lvl+".");
}
}
}
}
MessagePlayer("Entered In: "+GetVehicleNameFromModel( player.Vehicle.Model )+".")
[/noae][/noae]function GetVehicleNameFromModel(model)
{
switch(model)
{
case 130: return "Landstalker";
case 131: return "Idaho";
case 132: return "Stinger";
case 133: return "Linerunner";
case 134: return "Perennial";
case 135: return "Sentinel";
case 136: return "Rio";
case 137: return "Firetruck";
case 138: return "Trashmaster";
case 139: return "Stretch";
case 140: return "Manana";
case 141: return "Infernus";
case 142: return "Voodoo";
case 143: return "Pony";
case 144: return "Mule";
case 145: return "Cheetah #1";
case 146: return "Ambulance";
case 147: return "FBI Washington";
case 148: return "Moonbeam";
case 149: return "Esperanto";
case 150: return "Taxi";
case 151: return "Washington";
case 152: return "Bobcat";
case 153: return "Mr Whoopee";
case 154: return "BF Injection";
case 155: return "Hunter";
case 156: return "Police";
case 157: return "Enforcer";
case 158: return "Securicar";
case 159: return "Banshee";
case 160: return "Predator";
case 161: return "Bus";
case 162: return "Rhino";
case 163: return "Barracks OL";
case 164: return "Cuban Hermes";
case 166: return "Angel";
case 167: return "Coach";
case 168: return "Cabbie";
case 169: return "Stallion";
case 170: return "Rumpo";
case 171: return "RC Bandit";
case 172: return "Romero's Hearse";
case 173: return "Packer";
case 174: return "Sentinel XS";
case 175: return "Admiral";
case 176: return "Squalo";
case 177: return "Sea Sparrow";
case 178: return "Pizza boy";
case 179: return "Gang Burrito";
case 182: return "Speeder";
case 183: return "Reefer";
case 184: return "Tropic";
case 185: return "Flatbed";
case 186: return "Yankee";
case 187: return "Caddy";
case 188: return "Zebra Cab";
case 189: return "Top Fun";
case 190: return "Skimmer";
case 191: return "PCJ 600";
case 192: return "Faggio";
case 193: return "Freeway";
case 194: return "RC Baron";
case 195: return "RC Raider";
case 196: return "Glendale";
case 197: return "Oceanic";
case 198: return "Sanchez";
case 199: return "Sparrow";
case 200: return "Patriot";
case 201: return "Love Fist";
case 202: return "Coast Guard";
case 203: return "Dinghy";
case 204: return "Hermes";
case 205: return "Sabre";
case 206: return "Sabre Turbo";
case 207: return "Phoenix";
case 208: return "Walton";
case 209: return "Regina";
case 210: return "Comet";
case 211: return "Deluxo";
case 212: return "Burrito";
case 213: return "Spand Express";
case 214: return "Marquis";
case 215: return "Baggage Handler";
case 216: return "Kaufman Cab";
case 217: return "Maverick";
case 218: return "VCN Maverick";
case 219: return "Rancher";
case 220: return "FBI Rancher";
case 221: return "Virgo";
case 222: return "Greenwood";
case 223: return "Cuban Jetmax";
case 224: return "Hotring Racer #1";
case 225: return "Sandking";
case 226: return "Blista Compact";
case 227: return "Police Maverick";
case 228: return "Boxville";
case 229: return "Benson";
case 230: return "Mesa Grande";
case 231: return "RC Goblin";
case 232: return "Hotring Racer #2";
case 233: return "Hotring Racer #3";
case 234: return "Bloodring Banger #1";
case 235: return "Bloodring Banger #2";
case 236: return "Cheetah #2";
case 6400: return " "; //For the first custom car.
default: return "Name not specified";
}
}
[/noae][/noae] MessagePlayer("Entered In: "+GetVehicleType( player.Vehicle.Model )+".")
[/noae][/noae]function GetVehicleType( model )
{
switch ( model ) {
case 166:
case 178:
case 191:
case 192:
case 193:
case 198:
return "Bike";
case 155:
case 165:
case 217:
case 218:
case 227:
return "Heli";
case 180:
case 181:
return "Plane";
case 136:
case 160:
case 176:
case 182:
case 183:
case 184:
case 190:
case 202:
case 203:
case 214:
case 223:
return "Boat";
case 171:
case 194:
case 195:
case 231:
return "RC";
case 6400:
return "Special Model";
default:
return "Car";
}
}
[/noae][/noae]