This topic was marked solved by its starter, on September 20th, 2015, 05:20 AM
vehicles
VIP »

:P

  • Full Member
  • Posts: 155
vehicles
« on September 19th, 2015, 02:18 PM »Last edited on September 19th, 2015, 02:19 PM
not coming vehicles in game while vehicles created in database why   using kusnagi system for vehicles
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 811
Re: vehicles
« Reply #1, on September 19th, 2015, 02:24 PM »
Have you added LoadCars? And does it show any error?

Try in onScriptLoad

Code: [Select]
print("vehs: "+GetVehicleCount());
and see what it returns

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

Retired VC:MP Player/Scripter :P

:P

  • Full Member
  • Posts: 155
Re: vehicles
« Reply #2, on September 19th, 2015, 02:28 PM »
vehs = 0   and i add on scriptload  loadcar like that (" LoadCars () ; ") otherwise its show error loadcars does not exists
SLC is a good scripter but he always use bad words for abusing players :P

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 811
Re: vehicles
« Reply #3, on September 19th, 2015, 02:31 PM »
Code: [Select]
onScriptLoad()
{
LoadCars();
}
Add it any where in script better copy paste it at the end of your main.nut
Code: [Select]
function LoadCars()
{
 local q = QuerySQL( vdb, "SELECT * FROM Vehicles" ), i = 0;
 while( GetSQLColumnData( q, 0 ) )
 {
  local
   Model = GetSQLColumnData( q, 0 ),
   World = GetSQLColumnData( q, 1 ),
   PX= GetSQLColumnData( q, 2 ),
   PY = GetSQLColumnData( q, 3 ),
   PZ = GetSQLColumnData( q, 4 ),
   Angle = GetSQLColumnData( q, 5 ),
   col1 = GetSQLColumnData( q, 6 ),
   col2 = GetSQLColumnData( q, 7 );
 
  CreateVehicle( Model.tointeger(), World.tointeger(), Vector( PX.tofloat(), PY.tofloat(), PZ.tofloat() ), Angle.tofloat(), col1, col2 );
  GetSQLNextRow( q );
  i++;
 }
 print( "Cars loaded - " + i );

}

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

Retired VC:MP Player/Scripter :P

:P

  • Full Member
  • Posts: 155
Re: vehicles
« Reply #4, on September 19th, 2015, 02:39 PM »
what you do in that its start working
SLC is a good scripter but he always use bad words for abusing players :P

KAKAN

  • Wiki Contributor
  • Posts: 3,343
Re: vehicles
« Reply #5, on September 19th, 2015, 02:40 PM »
He;s the beginner version of FinchDon, killerx why don't you try to debug the thing yourself?
Anyways post your onscriptload event here
Re: vehicles
« Reply #6, on September 19th, 2015, 02:41 PM »
And are u calling the onscriptload or any event twice? If yes, then its kinda wrong
oh no

FinchDon

  • Sr. Member
  • Posts: 252
Re: vehicles
« Reply #7, on September 19th, 2015, 03:13 PM »
@KAKAN I know i was noob but not like him :(
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

  • Wiki Contributor
  • Posts: 3,343
Re: vehicles
« Reply #8, on September 19th, 2015, 03:15 PM »
Was? Really? :D, i know u r better than him
oh no

:P

  • Full Member
  • Posts: 155
Re: vehicles
« Reply #9, on September 20th, 2015, 05:20 AM »
@KAKAN   my prob solve by kusnagi but i ask what mistake i did >:(
SLC is a good scripter but he always use bad words for abusing players :P

VIP »