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 - Groovy

#1
@habi thanks for your help, i understood the logic xD. ;D

I suggest you to make new vehicle system because the last vehicle system is bugged.
Thanks 8)
#2
Ok, it got fixed. bro but the whole vehicle system is bugged i tried every command every command had a bug :( i fixed 7-8 bugs.

but some bugs i can't fix so im asking for help here...

else if ( (cmd == "carforsale") || (cmd == "carsforsale") )
{
local V2="";
local V=false;
for( local VehicleID = 0; VehicleID <= 1000; VehicleID++ )
{
local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+VehicleID+"'" );
local owner = GetSQLColumnData( q, 2 );
if("Unowned" == owner)
{
V=true;
V2+=""+VehicleID+",";
}
}
if (V==true) MessagePlayer("Vehicles ID: "+V2+"",player)
if (V==false) MessagePlayer( "No cars for sale.", player );
}


 :'( :-\ :-X :-[ :( >:(
#3
i fixed everything bro's

Now other error:
In this whole code. T_T

else if ( cmd == "setowner" )
{
   
    if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You're not registered.", player );
else if ( stats[ player.ID ].Log == false ) return MessagePlayer( "[#95fcff]WARN > [#E0E0E0]You're not Logged-In", player );
else if ( !text ) MessagePlayer("[#95fcff]WARN > [#E0E0E0]Command: /"+cmd+" <Nick/ID> <Veh/ID>", player);
else if ( !IsOwnerOrSharer( veh, player ) ) MessagePlayer("[#95fcff]WARN > [#E0E0E0]This vehicle is not belong to you", player );
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer("[#95fcff]WARN > [#E0E0E0]Unkown Player.", player );
else {
local veh = FindVehicle( GetTok( text, " ", 2 ).tointeger() );
if ( !veh ) MessagePlayer("[#95fcff]WARN > [#E0E0E0]Unkown vehicle ID", player );
else {
local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+veh.ID+"'" );
QuerySQL( Vehicles, "UPDATE Sale SET Owner='"+player.Name+"' WHERE ID='"+veh.ID+"'" );
Message( "[#95fcff]INFO > [#E0E0E0]Admin ["+player.Name+"] gave, Vehicle ID: "+veh.ID+" New Owner ["+plr.Name+"]" );
}
}
}
}
#4
thanks for your help - but it didn't worked. ;(
#5
habi this worked but the whole vehicle system is bugged. :(

local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+text+"'" );
local owner = GetSQLColumnData( q, 2 );

error in these line :null parameters:
#6
habi this error is fixed but when i enter in vehicle so error show in console:
local
full code
function onPlayerEnterVehicle( player, veh, isPassenger )
{
local VehicleID2 = QuerySQL( Vehicles, "SELECT * FROM Sale" );
if(VehicleID2)
{
local q = QuerySQL( Vehicles, "SELECT * FROM Sale WHERE ID='"+veh.ID+"'" );
local
Cost=GetSQLColumnData( q, 1 ),
Owner=GetSQLColumnData( q, 2 ),
Share=GetSQLColumnData( q, 3 ),
Sharer=GetSQLColumnData( q, 4 );
MessagePlayer( "ID: "+veh.ID+". Cost: "+Cost+".", player );
MessagePlayer( "Owner: "+Owner+". Shares: "+Share+" & "+Sharer+".", player );
}
}
#7
 i did this but still same error 8)
function LoadVehicles()
{
local q = QuerySQL( Vehicles, "SELECT * FROM Creation" ), i = 0;
if( q )
{
      while( GetSQLColumnData( q, 0 ) )
      {
           i++;
      }
}
local
Model= GetSQLColumnData( q, 1 ),
X= GetSQLColumnData( q, 2 ),
Y= GetSQLColumnData( q, 3 ),
Z= GetSQLColumnData( q, 4 ),
Col1= GetSQLColumnData( q, 5 ),
Col2= GetSQLColumnData( q, 6 ),
World= GetSQLColumnData( q, 7 ),
Angle= GetSQLColumnData( q, 8 );
CreateVehicle( Model, World, Vector(X, Y, Z), Angle, Col1, Col2 );
GetSQLNextRow( q );
i++;
print("Vehicles Count ("+i+")");
return 0;
}
#8
function LoadVehicles()
{
local q = QuerySQL( Vehicles, "SELECT * FROM Creation" ), i = 0;
while( GetSQLColumnData( q, 0 ) )
{
local
Model= GetSQLColumnData( q, 1 ),
X= GetSQLColumnData( q, 2 ),
Y= GetSQLColumnData( q, 3 ),
Z= GetSQLColumnData( q, 4 ),
Col1= GetSQLColumnData( q, 5 ),
Col2= GetSQLColumnData( q, 6 ),
World= GetSQLColumnData( q, 7 ),
Angle= GetSQLColumnData( q, 8 );
CreateVehicle( Model, World, Vector(X, Y, Z), Angle, Col1, Col2 );
GetSQLNextRow( q );
i++;
}
print("Vehicles Count ("+i+")");
return 0;
}

Database:
Vehicles <- ConnectSQL( "Databases/Vehicles.db" );

QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Creation ( id NUMERIC, model NUMERIC, x NUMERIC, y NUMERIC, z NUMERIC, col1 NUMERIC, col2 NUMERIC, world NUMERIC, angle NUMERIC)" );
QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Sale ( ID NUMERIC, Cost NUMERIC, Owner TEXT, Shared TEXT, Shared2 TEXT )" );
#9
:-[
hi everyone.
you can see im here with another problem.


error in LoadVehicle..

193th Line:while( GetSQLColumnData( q, 0 ) )180thLine:LoadVehicles();
#10
Good Luck Clan.
#11

Solved - The problem was in code. my friend fixed it.lock topic

habi brother thanks for your help.
#12
@habi thanks for finding out the bug.

but one problem that when i write /topkiller it shows players with low kills not high killers...
#13
Quote from: umar4911 on Apr 13, 2020, 12:15 PMand what is the error being displayed?
there is no error when i open the console.
#14
i did still not working bruh.



182th Line: q = QuerySQL( db, query );
28th Line: TopKillers();
#15
Hy bois.

function TopKillers()

local
query = "SELECT Name, Mato FROM Accounts ORDER BY Name DESC LIMIT 5", //Top 5
q,
Name1, Name2, Name3, Name4, Name5,
Top1, Top2, Top3, Top4, Top5, i = 1; 
q = QuerySQL( db, query );
while( GetSQLColumnData( q, 0 ) )
{
switch(i)
{
case 1:
Name1 = GetSQLColumnData( q, 0 );
Top1 = GetSQLColumnData( q, 1 );
break;
case 2:
Name2 = GetSQLColumnData( q, 0 );
Top2 = GetSQLColumnData( q, 1 );
break;
case 3:
Name3 = GetSQLColumnData( q, 0 );
Top3 = GetSQLColumnData( q, 1 );
break; 
case 4:
Name4 = GetSQLColumnData( q, 0 );
Top4 = GetSQLColumnData( q, 1 );
break;
case 5:
Name5 = GetSQLColumnData( q, 0 ); 
Top5 = GetSQLColumnData( q, 1 );
break; 
}
GetSQLNextRow( q );
i++;
}
FreeSQLQuery(q);
Message("[#00ffff]Top 5 Matadores | Killers[#000000]: [#00bfff]" + Name1 + " [#ffffff]: [#00ff00]" + Top1 + ", [#00bfff]" + Name2 + " [#ffffff]: [#00ff00]" + Top2 + ", [#00bfff]" + Name3 + " [#ffffff]: [#00ff00]" + Top3 + ", [#00bfff]" + Name4 + " [#ffffff]: [#00ff00]" + Top4 + ", [#00bfff]" + Name5 + " [#ffffff]: [#00ff00]" + Top5 + "");
}

else if (cmd =="topkiller")
{
TopKiller();
}

this ain't working. please help bois