null

Started by :P, Sep 17, 2015, 08:13 AM

Previous topic - Next topic

:P

when i type /car its say cose null ; 0x00000 owner null 0x000 sharer nul 0x0000 why
note: the cmds of kakan

car cmds
else if ( cmd == "car" )
 {
      local plr = GetPlayer( text );
  if ( !text ) MessagePlayer( "[Syntax] - /" + cmd + " <Nick/ID>.", player );
  else{
     if ( !plr ) MessagePlayer( "[Error] - Invalid Nick/ID", player );
  else if ( !plr.IsSpawned ) MessagePlayer( "[Error] - This player hasn't spawned.", player );
  else
  {
   local veh = plr.Vehicle;
   if ( veh )
   {
    local vid = veh.ID, hp = veh.Health.tointeger() /10;
    MessagePlayer( plr + " is driving a " + GetVehicleNameFromModel( veh.Model ) + " (ID: " + vid + ") (Health: " + hp + "%)", player );
    local q = QuerySQL( db, "SELECT * FROM Vehicles WHERE ID='" + veh.ID + "'" );
             MessagePlayer( "Vehicle:[ " + GetVehicleNameFromModel( veh.Model ) + " ] Cost:[ " + GetSQLColumnData( q, 1 ) + " ]", player );
             MessagePlayer( "ID:[ " + veh.ID + " ] Owner:[ " + GetSQLColumnData( q, 2 ) + " ] Share:[ " + GetSQLColumnData( q, 3 ) + " ]", player );
   }
   else MessagePlayer( plr + " is currently on foot.", player );
  }
  }
 }

function


function onPlayerEnterVehicle( player, vehicle, isPassenger )
{
 Announce( "~b~ ID ~p~" +  vehicle.ID  + ".",player,4);
MessagePlayer("[#1fcecb]Press [#50c878]I[#1fcecb] rapidly to activate boost .",player); 
MessagePlayer("[#FFFFFF]Have 100000?.Type /buycar " + vehicle.ID + " to buy this car if its forsale",player);   
return 1;
}
function onPlayerExitVehicle( player, vehicle )
{
                  Announce( "~b~ ID ~p~" +  vehicle.ID  + ".",player,4);
ePrivMessage("Exit Vehicle ID: " + vehicle.ID + ".",player);
}
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

#1
Because you havent saved vehicle data in database. Have you created Vehicles table in db? Search EXISTS Vehicles in your .nut files and pass that line here

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

:P

#2
function VehExists( veh )
{
    if ( veh <= GetVehicleCount() ) return 1;
   else return 0;
}
SLC is a good scripter but he always use bad words for abusing players :P

:P

in database the table added with cars
SLC is a good scripter but he always use bad words for abusing players :P

KAKAN

Wait.. What? My cmds? I have never done a query on a simple car cmd
Better use this one:-
http://forum.vc-mp.org/?topic=1454.0
oh no

KAKAN

And yes, how did you announce the text at the bottom of the screen?(left-bottom)
oh no

:P

this script cmds doesnt works for me i try
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

#7
Forget that,

Just do /iamdoing once while in server then wait 5 minutes

Put this cmd
else if(cmd =="iamdoing")
{
MessagePlayer("doing just wait 5 minutes",player);
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Vehicles ( Cost INT, Owner TEXT, Shared TEXT)");
local Max= GetVehicleCount();
for(local i=0; i < Max; i++)
{
QuerySQL( db, "INSERT INTO Vehicles ( Cost, Owner, Shared) VALUES ( '600000', 'Vice-City', 'None')" );
print("Done ID: "+i.tointeger());
}
}
After 5 minutes restart server then try /car

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

:P

SLC is a good scripter but he always use bad words for abusing players :P

:P

in db   table name is cars and in cmds everywhere vehicles involved is its effect
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

Yea it effects try changing Vehicles to cars

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

Quote from: xxkillerxx on Sep 17, 2015, 08:54 AMin db   table name is cars and in cmds everywhere vehicles involved is its effect

LOL!! You should tell this at 1st
oh no

:P

solved but its credits goto whose   ;) :D
i want to when i sited in cars i type /car show me its price owner ect dont ask for nick in which car i sit tell me the car information if i am not in car then ask nick
SLC is a good scripter but he always use bad words for abusing players :P

:P

Quote from: xxkillerxx on Sep 17, 2015, 08:29 AMin database the table added with cars
i tell it but you guys did not take attention i tell you 35 mint ago
SLC is a good scripter but he always use bad words for abusing players :P

rObInX

#14
To do what you meant, just remove the part where it asks for name. Is that so hard?
Please "learn" to script.

else if ( cmd == "car" )
 {
   local veh = player.Vehicle;
   if ( veh )
   {
        local vid = veh.ID, hp = veh.Health.tointeger() /10;
        MessagePlayer( plr + " is driving a " + GetVehicleNameFromModel( veh.Model ) + " (ID: " + vid + ") (Health: " + hp + "%)", player );
        local q = QuerySQL( db, "SELECT * FROM Vehicles WHERE ID='" + veh.ID + "'" );
        if ( GetSQLColumnData( q, 1 ) )
        {
         MessagePlayer( "Vehicle:[ " + GetVehicleNameFromModel( veh.Model ) + " ] Cost:[ " + GetSQLColumnData( q, 1 ) + " ]", player );
         MessagePlayer( "ID:[ " + veh.ID + " ] Owner:[ " + GetSQLColumnData( q, 2 ) + " ] Share:[ " + GetSQLColumnData( q, 3 ) + " ]", player );
        }
     }
 }