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

Topics - Finch

#1
i haert warchief to 0.4 and i add all system in it but when i quit stats are not save it say on console GetStats index IsReg does not exist

this is getstats
function SaveStats( player )
{
       try{
   local id = player.ID;
   if ( status[ id ].IsReg == true )
   {
       QuerySQL( db, "UPDATE Account SET Kills='" + status[ id ].Kills + "', Deaths='" + status[ player.ID ].Deaths + "', Cash='" + status[ id ].Cash + "', Bank='" + status[ id ].Bank + "', Joins='" + status[id].Joins + "' WHERE Name='" + player.Name.tolower() + "'" );
   print( "Saved Stats of Player " + player.Name + "[" + player.ID + "]" );
   status[ id ] = null;
   }
   }
   catch(e) print( "Save Stats Error: " + e );
}
#2
Scripting and Server Management / Server Down
Apr 20, 2015, 04:45 AM
Hello Friends
My Server is not showing on masterlist of 0.4 i also has loaded announce04rel32 plugins but when i check from this http://thijn.minelord.com/vcmp/checker/ it say on0.4 mastler list No i also port forward what is error
#3
Scripting and Server Management / Forsale
Apr 19, 2015, 06:49 AM
My forsale system  not working when i do /forsale it say total cars 0 rc 0 bikes 0 etc 0
this is command and whole function

function Start()
{
    try{
local a = 1;
while( a <= GetVehicleCount() )
{
QuerySQL( sqliteDB, "UPDATE Cars SET Owner='Vice-City' WHERE ID='" + a + "'" );
a ++;
}
}
catch(e) print( "lol: " + e );

}

function Cars()
{
local a = 1, MaxCars = GetVehicleCount();
while ( a <= MaxCars )
{
local veh = FindVehicle( a );
if ( veh )
{
QuerySQL( sqliteDB, "REPLACE INTO Cars ( ID, Cost, Owner, Shared ) VALUES ( '" + veh.ID + "', '100000', 'Vice-City', 'None' )" );
}
a ++;
}
}

function ForsaleCars()
{local a = 1, b = 0;
while ( a <= GetVehicleCount() )
{local q = QuerySQL( sqliteDB, "SELECT * FROM Cars WHERE ID='" + a.tointeger() + "'" );
if ( GetSQLColumnData( q, 2 ) == "Vice-City" )
{b++;
local veh = FindVehicle( a.tointeger() );
local vehicle = GetVehicleType( veh.Model );
if ( vehicle == "Car" ) Car++;
else if ( vehicle == "Plane" ) Plane++;
else if ( vehicle == "Boat" ) Boat++;
else if ( vehicle == "RC" ) RC++;
else if ( vehicle == "Bike" ) Bike++;
else if ( vehicle == "Heli" ) Heli++;
}
a++;
}
return b;
}
function GetVehicleType( model ) {
// Returns: Car / Bike / Heli / Plane / Boat / RC
switch ( model ) {
case 136:
case 160:
case 176:
case 182:
case 183:
case 184:
case 190:
case 202:
case 203:
case 214:
case 223:
return "Boat";
break;
case 155:
case 165:
case 217:
case 218:
case 227:
return "Heli";
break;
case 166:
case 178:
case 191:
case 192:
case 193:
case 198:
return "Bike";
break;
case 171:
case 194:
case 195:
case 231:
return "RC";
break;
case 180:
case 181:
return "Plane";
break;
default:
return "Car";
break;
}
}

function PlayerCars( player )
{
local a = 1, b = 0;
while ( a <= GetVehicleCount() )
{
if ( CarOwner( a ).tolower() == player.Name.tolower() )
{
b ++;
}
a ++;
}
return b;
}


Command

else if ( cmd == "forsale" )
{
Message( "Total Vehicles: " + ForsaleCars() + "." );
Message( "Cars: " + Car + ", Bikes: " + Bike + ", Planes: " + Plane + ", RC: " + RC + ", Boats: " + Boat + ", Helis: " + Heli + "." );
Empty();
}

and on scriptload

Car <- 0;
   Bike <- 0;
   RC <- 0;
    Plane <- 0;
   Boat <- 0;
   Heli <- 0;
#4
Scripting and Server Management / ShareCar
Apr 17, 2015, 10:31 AM
My sharecar is not working when i do /sharecar Finch its say u are sharing car with Finch but when i do /car 0 its say shared none

else if ( cmd == "sharecar1" )
{
if ( stats[player.ID].Logged == true )
{
if ( stats[player.ID].Logged == true )
{
if ( player.Vehicle )
{
local Cars = QuerySQL( sqliteDB, "SELECT Owner FROM Cars WHERE ID LIKE '" + player.Vehicle.ID + "'" );

if ( GetSQLColumnData( Cars, 0 ) != player.Name ) ClientMessage ( "Error - You don't own this car.", player,255,255,0);
else
{
if ( text )
{
local plr = FindPlayer( text );

if ( plr )
{
   if ( stats[ player.ID].Logged == true )
{
QuerySQL( sqliteDB, "UPDATE Vehicles SET Shared = '" + plr.Name + "' WHERE ID = '" + player.Vehicle.ID + "'" );

ClientMessage ( "You are now sharing your " + GetVehicleNameFromModel( player.Vehicle.Model ) + " with " + plr.Name, player,255,255,0);

ClientMessage ( player.Name + " is now sharing his " + GetVehicleNameFromModel( player.Vehicle.Model ) + " (ID: " + player.Vehicle.ID + ") with you.", plr,255,255,0);
}
else ClientMessage ( "Error - " + plr.Name + " is not a registered nickname.", player,255,255,0);
}
else ClientMessage ( "Error - No such player.", player,255,255,0);
}
else ClientMessage ( "Usage: !" + cmd + " <nick/ID>", player,255,255,0);
}
}
else ClientMessage ( "Error - You need to be in the vehicle you want to share.", player,255,255,0);
}
else ClientMessage ( "Error - You are not logged in.", player,255,255,0);
}
else ClientMessage ( "Error - You haven't registered your nickname.", player,255,255,0);
}
#5
Scripting and Server Management / Setlevel
Apr 17, 2015, 07:18 AM
My setlevel command not working when i do/setlevel 0 7 its say level set to 7 when i do /admins level does not change this is command
else if ( cmd == "setlevel" )
   {
   if( stats[ player.ID ].Logged == false ) MessagePlayer( "Error - You don't have Login acess.", player);
   else if ( stats[ player.ID ].Level < 7 ) MessagePlayer( "Error - You don't have access to it.", player);
   else if ( !text ) yPrivMessage( "Syntax, / " + cmd + " <Nick/ID> <Level 3, 4 ,5> ", player );
   local plr = GetPlayer( GetTok( text, " ", 1 ) ), lvl = GetTok( text, " ", 2 );
   if ( !plr ) yPrivMessage( "Unknown Player..", player );
   else
    {
      if (!IsNum(lvl)) yPrivMessage("Level Must Be In Numbers..",player);
      else
      {
      yPrivMessage(" Admin " + player.Name + " Set Level To " + plr.Name + ", Level: " + lvl + ".",player);
      QuerySQL( sqliteDB,"UPDATE Accounts SET Level='" + lvl + "' WHERE Name='" + player.Name.tolower() + "'");
      }
   }
   }
#6
Scripting and Server Management / Ban System
Apr 16, 2015, 05:43 AM
Hi guys i am facing problem on my ban system wen i ban my self itban me when i join with another nick its unban what is problem this is ban command and ban system

else if ( cmd == "ban" )
{
         if( stats[ player.ID ].Logged == false ) MessagePlayer( "Error - You don't have Login acess.", player);
   else if ( stats[ player.ID ].Level < 8 ) MessagePlayer( "Error - You don't have access to it.", player);
   else if ( !text ) MessagePlayer( "Error - Syntax: /ban <player> <reason>", player);
   else
   {
     local plr = GetPlayer( GetTok( text, " ", 1 ) );
     if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
     else
     {
       local reason = GetTok( text, " ", 2 );
   if ( !reason ) reason = "None";
   Ban( plr, reason );
     }
   }
}



And this is function


function Ban( player, reason )
{
    QuerySQL( sqliteDB, "INSERT INTO Bans VALUES('" + player.Name.tolower() + "', '" + player.IP + "', '" + player.UniqueID + "', '" + reason + "')" );
 Message( "" + player.Name + " have been banned from the server. Reason: " + reason + "." );
    player.Kick();
player.UniqueID;
}


function CheckBan( player )
{
  local query = QuerySQL( sqliteDB, "SELECT * FROM Bans WHERE UID='" + player.UniqueID + "'" );
if( GetSQLColumnData( query, 0 ) ) return 1;
else return 0;
FreeSQLQuery( query );
}
#7
Scripting and Server Management / Adminship
Apr 14, 2015, 09:36 AM
Hello!

Today i was making adminship system when i join server and type /adminship name and reason its asay your appeal is gone but when i join again and type /adminship name and reason nothing happens then i check console that is error

adn then that is line

QuerySQL( sqliteDB, "INSERT INTO Adminship (Name, IP, Reason, Player) values ( '" + plr.Name + "', '" + plr.IP + "', '"+Reason+"', '"+player.Name+"' )" );
#8
Servers / Adventure New City Extreme Server
Apr 12, 2015, 02:07 PM
Server Name: Adventure New City Extreme Server
Game Mode: Adventure City
Server IP: 39.32.58.13:5192
Forum:adventure-world.tk
Scripter: Finch
Credit: DeCenT_BoY
^Developer: Finch
Helper:Blood_Master



Visitors:[DS]Steam
#9
Scripting and Server Management / Prop System
Apr 10, 2015, 10:40 AM
Hi Guys
Well i have prop system i test it but it give me error on ShareProp command
There is ShareProp Command


else if ( cmd == "shareprop" )
{
  if ( !text ) MessagePlayer( "Use /shareprop  <Nick/ID> <Prop>", player );
    local id = player.ID
if ( !stats[ id ].Logged ) ePrivMessage( "[Error] - You're Not logged in..", player );
else if ( !player.IsSpawned ) ePrivMessage( "[Error] - You haven't spawned yet..", player );
else if ( !text ) ePrivMessage( "[Syntax] - !" + cmd + " <ID> <Nick>", player );
else if ( !IsNum( GetTok( text, " ", 1 ) ) ) ePrivMessage( "[Error] - ID must be Number..", player );
else if ( !PropExists( GetTok( text, " ", 1 ).tointeger() ) ) ePrivMessage( "[Error] - Invalid Prop ID", player );
[color=teal]It always give error here ( q does not exist ) [/color] if ( GetSQLColumnData( q, 3 ) != player.Name ) ePrivMessage( "[Error] - You don't own this Property", player );
else
{
    local plr = GetPlayer( GetTok( text, " ", 2 ) );
if ( !plr ) ePrivMessage( "[Error] - Invalid Nick / ID", player );
else
{
    QuerySQL( sqliteDB, "UPDATE Props SET Shared='" + plr.Name + "' WHERE rowid='" + GetTok( text, " ", 1 ) + "'" );
rPrivMessage( "You shared your Prop:[ " + GetSQLColumnData( q, 0 ) + " ] with: " + plr.Name + ".", player );
rPrivMessage( "Player " + player.Name + " shared Prop ID:[ " + GetTok( text, " ", 1 ) + " ] with you.", plr );
}
}

}

#10
Well i am using Fuzzie Account system but i am facing problem on setpassword command when i set password it say on console password does not exist and password also didnt change this is command

else if ( cmd == "setpassword" )
{
           if( stats[ player.ID ].Logged == false ) MessagePlayer( "Error - You don't have Login acess.", player);
   else if ( stats[ player.ID ].Level < 7 ) MessagePlayer( "Error - You don't have access to it.", player);
else if ( !text ) qPrivMessage( "Syntax, " + cmd + " [Nick/ID] [Password]",player );
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) qPrivMessage( "Error: Invalid Player.",player );
else {
local newpass = GetTok( text, " ", 2);
if ( newpass == null ) qPrivMessage("Enter A Valid Password.",player );
else {
qPrivMessage("Admin " + player + " Set Your Password To: " + newpass + ".", plr);
qPrivMessage(" Changed Password Of " + plr.Name + " To: " + newpass + ".", player);
QuerySQL(sqliteDB,"UPDATE Accounts SET Password='" + SHA256( password ) + "' WHERE Name='" + plr.Name + "'");
}
}
}
}
#11
Scripting and Server Management / WBStats
Apr 03, 2015, 04:48 AM
Hey guyz i add wbstats in my server but  they give me error on function register  on line these of wbstats
QuerySQL( sDB, "INSERT INTO BodyStats (Name, BodyParts) VALUES (%s'%i')", player.Name, "0 0 0 0 0 0 0)" );
QuerySQL( sDB, format( "REPLACE INTO WeaponStats (Name, Weps) VALUES ('%i')", player.Name, "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" ) );     



And  error is sorry but i cant post screen shot due to reason

this is error
wrong number of parametes
#12
I facing problem i have my admin commands and i am using fuzzie account system i add a function in setlevel cmd that if there is someone is not login and use admin command it can be use what the problem this is admin cmd'




then i goto server without login and try command it say that








What is Problem?
#13
Snippet Showroom / Evaluation System
Apr 01, 2015, 09:15 AM
Hi and Hello Guyz I am Back to VCMP i was gone for some work And i am back with usefull snipets
Evaluation system is like if u make any admin in your server then use /addadmin full name then admin name will add it will show that admin has how much kicks and bans you have to type /einfo admin full name if exist then its will show
admin name:
kicks:
bans:
 then it will be easy for owner to promote admin or demote

Commands

/einfo, /addadmin, /removeadmin.

Just Add this on Functions.nut


function SetBan( player, amount )
{
QuerySQL(db, "UPDATE Evaluation SET Ban='" + amount.tointeger() + "' WHERE Name='" + player.Name + "'");
}
function GetBan( player )
{
local Ban = GetSQLColumnData( QuerySQL( db, "SELECT Ban FROM Evaluation WHERE Name='" + player.Name+"'" ), 0 );
if ( Ban ) return Ban;
else return 0;
}
function SetKick( player, amount )
{
QuerySQL(db, "UPDATE Evaluation SET Kick='" + amount.tointeger() + "' WHERE Name='" + player.Name + "'");
}
function GetKick( player )
{
local Kick = GetSQLColumnData( QuerySQL( db, "SELECT Kick FROM Evaluation WHERE Name='" + player.Name+"'" ), 0 );
if ( Kick ) return Kick;
else return 0;
}


Add this on CreateTables();

QuerySQL( db, "CREATE TABLE IF NOT EXISTS Evaluation  ( Name VARCHAR(25), Ban INT(18),Kick INT(18))" );


Add these Commands on Commands.nut

else if ( cmd == "einfo" )
{
            if ( !text ) Message( "Error - Syntax: " + cmd + " <FullNick> ");
local q = QuerySQL( db, "SELECT * FROM Evaluation WHERE Name='" + text + "' COLLATE NOCASE" );
if ( !GetSQLColumnData( q, 0 ) )Message( "Error "+text+" -is not An Admin ");
  else
{
    Message( "Evaluation of : " + GetSQLColumnData( q, 0 ) );
    Message( "Evaluation:Bans : " + GetSQLColumnData( q, 1 ) );
    Message( "Evaluation:Kicks : " + GetSQLColumnData( q, 2 ) );
}
}


else if ( cmd == "addadmin" )
{
if ( stats[ player.ID ].Logged == false ) MessagePlayer( "[Error] - You're Not login!", player );
else if ( !text ) MessagePlayer( "Syntax, / " + cmd + " <Name>", player );
else
{
         ClientMessage( "Admin added.", player,255,255,0);
          QuerySQL( db, "INSERT INTO Evaluation (Name, Ban, Kick) values ( '" + text + "', '0', '0' )");
}
}
else if ( cmd == "removeadmin" )
{
if ( stats[ player.ID ].Logged == false ) MessagePlayer( "[Error] - You're Not login!", player );
else if ( !text ) MessagePlayer( "Syntax, / " + cmd + " <Name>", player );
else
{
                QuerySQL( db, "DELETE FROM Evalutation WHERE Name LIKE '%" + text + "%'" );     
           ClientMessage( "Admin deleted.", player,255,255,0);
}               
}


Add this on Kick Function
        SetKick(admin,GetKick(admin)+1);

Add this on Ban Function
    SetBan(admin,GetBan(admin)+1);



Sorry for my disturbence last time on Forum



UPDATED
#14
Scripting and Server Management / savestats
Mar 21, 2015, 01:47 PM
my save stats system not working when i kill someone then i type /stats it tell kills 1 then when i do /q it say in console save stats player and when i rejoin and type /stats 0 kills and 0 deaths what is this?

this is savestats function
function SaveStats( player )
{
       try{
   local id = player.ID;
   if ( status[ id ].IsReg == true )
   {
       QuerySQL( db, "UPDATE Account SET Kills='" + status[ id ].Kills + "', Deaths='" + status[ player.ID ].Deaths + "', Cash='" + status[ id ].Cash + "', Bank='" + status[ id ].Bank + "' WHERE Name='" + player.Name.tolower() + "'" );
   print( "Saved Stats of Player " + player.Name + "[" + player.ID + "]" );
   status[ id ] = null;
   }
   }
   catch(e) print( "Save Stats Error: " + e );
}

#15
How can i add speedo meter in my server
#16
Snippet Showroom / Ignore or Unignore System
Mar 15, 2015, 04:02 AM
I have created a ignore and unignore system Its so simple

Add this on Commands.nut

   else if ( cmd == "ignore" )
{
if ( status[ player.ID ].IsReg == true )
{
if ( status[ player.ID ].IsLogged == true )
{
if ( text )
{
local plr = FindPlayer( text );
if(plr)
{
if(plr.ID==player.ID) ClientMessage( "You cannot ignore yourself.", player,255,255,0);
else if ( player.GetIgnoredBy( plr )) ClientMessage( "You're already ignoring that player.",player,255,255,0);
else
{
player.SetIgnoredBy( plr, true );
ClientMessage( "IGNORE: You're now ignoring " + plr.Name + ", you wont be able to see his/her messages.", player,255,255,0);
ClientMessage( "IGNORE: You're now being ignored by " + player.Name + ", he/she wont be able to see your messages.", plr,255,255,0);
ClientMessageToAll( "> " + player.Name + " is now ignoring " + plr.Name + ".",255,255,0);
}
}
else ClientMessage ( "Error - That player does not exist.",player,255,255,0);
}
   else ClientMessage ( "USAGE: /c ignore [ NICK/ID ]", player, 255,255,0);
   }
   else ClientMessage ( "Error - Please log-in to your account.", player, 255,255,0);
   }
   else ClientMessage ( "Error - Please register your account.", player,255,255,0);
   }

else if ( cmd == "unignore" )
{
if ( status[ player.ID ].IsReg == true )
{
if ( status[ player.ID ].IsLogged == true )
{
if ( text )
{
local plr = FindPlayer( text );
if(plr)
{
if ( player.GetIgnoredBy( plr ))
{
player.SetIgnoredBy( plr, false );
ClientMessage( "UN-IGNORE: You're no longer ignoring " + plr.Name + ", you are now able to see his/her messages.", player,255,255,0);
ClientMessageToAll( "> " + player.Name + " is no longer ignoring " + plr.Name + ".",255,255,0);
}
else ClientMessage( "You're currently not ignoring that player.",player,255,255,0);
}
else ClientMessage ( "Error - That player doesn't exist.",player,255,255,0);
}
else ClientMessage ( "USAGE: /c unignore [ NICK/ID ]",player,255,255,0);
}
else ClientMessage ( "Error - Please log-in to your account.", player, 255,255,0);
   }
   else ClientMessage ( "Error - Please register your account.", player,255,255,0);
   }





It was too simple maybe help u
#17
Hi i have create a levelup command its not working its always say p does not exist or id does not exist

else if ( cmd == "levelup" )
{
        local id = p.ID;
   local kills = status[ id ].Kills;
        if (kills < 500) rPrivMessage( "[Error] You need to have 500 kills to get level up", player );
else
{
      if (kills > 500) rPrivMessage( "[Error] Your level is up Congratz", player );
      QuerySQL(db,"UPDATE Account SET Level='" 2  "' WHERE Name='" + player.Name.tolower() + "'");
}
}



Fucntion of Stats

function GetStats( p )
{
       try{
   local stats = null;
   if ( status[ p.ID ].IsReg == true )
   {
   local id = p.ID;
   local kills = status[ id ].Kills, deaths = status[ id ].Deaths;
   if ( ( kills > 0 ) && ( deaths > 0 ) )
   {
       local ratio = format( "%.2f", kills.tofloat() / deaths.tofloat() );
   stats = "Kills: " + kills + ", Deaths: " + deaths + ", Ratio: " + ratio + ".";
   }
   else
   {
       stats = "Kills: " + status[id].Kills + ", Deaths: " + status[id].Deaths + ".";
   }
   }
   else
   {
       stats = "This Nick-Name is not registered!";
   }
   return stats;
   }
   catch(e) print( "GetStats Error: " + e );
}
#18
Scripting and Server Management / Bomb System
Mar 13, 2015, 03:45 PM
Well i am facing problem like i face in offerdrugs i add buybomb and plantbomb command but in playerstats there is gettedbomb = 0;

when i buybomb and type /plantbomb t say in console gettedbomb does not exist
Problem?
#19
Scripting and Server Management / RentHeli
Mar 13, 2015, 03:07 PM
Well i See RentHeli Command Which take rent 20000 for one day for heli
what is it function i want this cmd give me example plz
#20
Hello Can Any oNE Can Give me exmaple how to make Myspawnwep command?