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 - Debian
1
Scripting and Server Management / VPS connect sql
« on September 18th, 2015, 06:45 AM »
the index connect sql doesn't exit , i am using all plugins in along with sqlite


Code: [Select]


function onScriptLoad(){

stats <- array( GetMaxPlayers(), null );
sqliteDB <- ConnectSQL( "database.db" );

foreach (key, val in Commands) CommandsList.push( key);
foreach (key, val in Commands) PlayerCommands.push( key+" "+ val);

print( "VCDM - SQLite variant has successfully loaded..." );
}


2
Script Showroom / Total War DM
« on September 17th, 2015, 06:43 AM »
Hello,

I have seen many people that could not set up a 0.4 Warchiefs Death Match server, so I made a VCMP DM server that could help some of them.

Download Link : File Dropper
Mediafire : https://www.mediafire.com/?k5b138d25839m3h

Antivirus tested

Tables :

CREATE TABLE Accounts ( Name VARCHAR(255), NameLower VARCHAR(255), Password VARCHAR(255), Cash INT, Bank INT, Kills INT, Deaths INT, Level INT, LastActive INT, LastUsedIP VARCHAR(255), DateRegistered INT )

CREATE TABLE Bans ( NameLower VARCHAR(255), UID VARCHAR(255), Reason VARCHAR(255) )

CREATE TABLE Gotoloc ( Name VARCHAR(32), x INT, y INT, z INT, Creator VARCHAR(32))


Any bugs , report below

Update 1 : Previous topic deleted
Update 2 : Warchiefs to DM
3
Scripting and Server Management / Not Inserting into database
« on September 14th, 2015, 05:37 AM »
All my other queries working and inserting to tables but this one is not inserting i had made sure all my database inserts properly
Code: [Select]

CREATE TABLE Dstats( Name TEXT, stat BOOLEAN, nogoto BOOLEAN, randspawn BOOLEAN, spawnwep BOOLEAN, wep1 INT, wep2 INT, wep3 INT, wep4 INT, wep5 INT, wep6 INT, wep7 INT, wep8 INT, wep9 INT, wep10 INT, spawnloc BOOLEAN, X FLOAT, Y FLOAT, Z FLOAT )
Code: [Select]

class DebianStats{
// ------------------------------------------------------------------- //

stat = false;
nogoto = false;
randspawn = false;
spawnwep = false;
wep1 = 0;
wep2 = 0;
wep3 = 0;
wep4 = 0;
wep5 = 0;
wep6 = 0;
wep7 = 0;
    wep8 = 0;
wep9 = 0;
wep10 = 0;
spawnloc = false;
X = 0.0;
Y = 0.0;
Z = 0.0;

// ------------------------------------------------------------------- //

constructor( playerName, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT stat, nogoto, randspawn, spawnwep, wep1, wep2, wep3, wep4, wep5, wep6, wep7, wep8, wep9, wep10, spawnloc, X, Y, Z FROM WStats WHERE Name='" + playerName.tolower() + "'" );
if( ::GetSQLColumnData( query, 15 ) ){
stat = ::GetSQLColumnData( query, 0 );
nogoto = ::GetSQLColumnData( query, 1 );
randspawn = ::GetSQLColumnData( query, 2 );
spawnwep = ::GetSQLColumnData( query, 3 );
wep1 = ::GetSQLColumnData( query, 4 );
wep2 = ::GetSQLColumnData( query, 5 );
wep3 = ::GetSQLColumnData( query, 6 );
wep4 = ::GetSQLColumnData( query, 7 );
wep5 = ::GetSQLColumnData( query, 8 );
wep6 = ::GetSQLColumnData( query, 9 );
wep7 = ::GetSQLColumnData( query, 10 );
wep8 = ::GetSQLColumnData( query, 11 );
wep9 = ::GetSQLColumnData( query, 10 );
wep10 = ::GetSQLColumnData( query, 11 );
spawnloc = ::GetSQLColumnData( query, 12 );
X = ::GetSQLColumnData( query, 13 );
Y = ::GetSQLColumnData( query, 14 );
Z = ::GetSQLColumnData( query, 15 );
}
::FreeSQLQuery( query );
}


function Update( player, dbGlobal ){
::QuerySQL( dbGlobal, "UPDATE Dstats SET stat = "+ stat +", nogoto = "+ nogoto +", randspawn = "+ randspawn +",spawnwep = "+ spawnwep +", wep1 = "+ wep1 +", wep2 = "+ wep2 +", wep3 = "+ wep3 +", wep4 = "+ wep4 +", wep5 = "+ wep5 +", wep6 = "+ wep6 +", wep7 = "+ wep7 +", wep8 = "+ wep8 +", wep9 = "+ wep9 +", wep10 = "+ wep10 +", spawnloc = "+ spawnloc +", X = "+ X +", Y = "+ Y +", Z = "+ Z +" WHERE Name='" + player.Name.tolower() + "'");
}

function Register( player, dbGlobal ){
::QuerySQL( dbGlobal, "INSERT INTO Dstats VALUES ( '" + player.Name.tolower() + "', false, false, false, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false, 0.0, 0.0, 0.0 )" );
}
}
4
Scripting and Server Management / Wep stats? Large database
« on September 13th, 2015, 11:04 AM »
I made a wep stats but it has large database like 32 queries and i made it to store the values in a array , So that means each time when a player logins it makes 32 queries at a time . Does that make a lot of lag? any way to make it better?
5
Scripting and Server Management / How to get a name from a array?
« on September 12th, 2015, 04:22 PM »
Nogoto + on works perfect, but there in nogoto off i get a problem at  nogoto.remove( player.Name ); because it is not a integer. I dont want to use player.ID because  i will save that array while unloading. So this can prevent additional database from making and reduce usage of a lot of databases because i will be using for other scripts too.

Code: [Select]
else if ( cmd == "nogoto" ) {
if (params[0] == "on") {
if(nogoto.find( player.Name ) == null){
nogoto.push( player.Name );
MessagePlayer( "Players cannot teleport to you.", player );
}
else MessagePlayer( "You have already enabled nogoto.", player );
}
else if (params[0] == "off") {
if(nogoto.find( player.Name ) != null){
nogoto.remove( player.Name );
MessagePlayer( "Players can teleport to you.", player );
}
else MessagePlayer( "You have already disabled nogoto.", player );
}
else  MessagePlayer( "Correct Syntax : /" + cmd + " on/off ", player );
}
6
Scripting and Server Management / some functions need details
« on September 12th, 2015, 04:22 AM »
Any details about these ? ???

Player.Class
Player.Colour
Player.HasChatTags
Player.HasMarker
Player.Redirect
Player.SecWorld
Player.Slot               // by default it is 0
Player.StandingOnObject
Player.StandingOnVehicle    // I need this
Player.PutInVehicleSlot


GetDeathmatchScoreboard
SetDeathmatchScoreboard

know details of some functions, Correct me if i'm wrong.
Player.GameKeys  // to find multiple/single keys player is pressing, shitft + Up = 33792
Player.Away // its true if player is spawned, false if player is spawned just as another player.isspawned
7
Scripting and Server Management / Newtimer vs OnPlayerTime Change?
« on September 11th, 2015, 02:02 PM »
I made a heal command without timer. What do think i used a good method or bad?
and i want to use this way for other cmds as a timer is it good way? What do you think?
Code: [Select]
Player class
CMD = "";
CMDTimer = 0;


function onTimeChange(oldHour, oldMin, newHour, newMin) {
seconds++;
        local plr;
foreach(i, val in playerson){
plr = FindPlayer(i);
if(stats[ plr.ID ].CMD == "heal"){
stats[ plr.ID ].CMDTimer++;
if (stats[ plr.ID ].CMDTimer == 3 ){
FindPlayer(i).Health = 100;
MessagePlayer("Healed", plr);
stats[ plr.ID ].CMD == "";
stats[ plr.ID ].CMDTimer == 0;
}
}
}
}

else if ( cmd == "heal" )
    {
    if ( !player.IsSpawned ) MessagePlayer( "[Error] - You haven't spawned yet..", player );
else if ( player.Health == 10 ) MessagePlayer( "[Error] - You don't need to be healed", player );
else if ( player.Cash < 0 ) MessagePlayer( "[Error] - You need $250 to heal yourself!", player );
else
{
   stats[ player.ID ].CMD = "heal";
               MessagePlayer( "Your will be healed in 3 seconds to prevent abuse...", player );
}
}
8
Scripting and Server Management / A question
« on September 8th, 2015, 01:54 PM »
a <- {
   a="one"
    b="two"
   }

a.rawget("a") gives value one and if it is a.rawget("d") it gives error . i want to make a check if it d or any other that doesn't exist in the table . How to check?

Thanks in Advance
9
Scripting and Server Management / Putting player in a vehicle
« on September 7th, 2015, 12:24 PM »
I'm making a derby system so a player should be put in vehicle directly but this is not happening all the times help how to fix this:
There is no error but player is not getting inserted into vehicle when derby starts.

http://forum.vc-mp.org/?topic=1429.0 for more info
Code: [Select]

function derbyann()
{
/* I repeated these made times to prevent bugs*/
foreach(i, val in playerson ) {
FindPlayer( i ).Spawn();
FindPlayer( i ).Vehicle = FindVehicle( i );
FindPlayer( i ).IsFrozen = true;
}
  NewTimer( "Ann", 2000, 1, "3" );
  foreach(i, val in playerson ) {
FindPlayer( i ).Vehicle = FindVehicle( i );
FindPlayer( i ).IsFrozen = true;
}
  NewTimer( "Ann", 4000, 1, "2" );
   foreach(i, val in playerson ) {
FindPlayer( i ).Vehicle = FindVehicle( i );
FindPlayer( i ).IsFrozen = true;
}
  NewTimer( "Ann", 6000, 1, "1" );
   foreach(i, val in playerson ) {
FindPlayer( i ).Spawn();
FindPlayer( i ).Vehicle = FindVehicle( i );
FindPlayer( i ).IsFrozen = true;
}
}