SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 25/07/2016, 10:51 AM   #1
justjamie
Huge Clucker
 
Join Date: May 2014
Posts: 424
Reputation: 5
Default Vehicle doesn't reload

Hello.
My vehicles doesnt reload at all.
What did i do wrong here?
PHP Code:
stock ReloadVehicle(i)
{
    
DestroyVehicle(i);
    new 
query1[128]; mysql_format(connectionquery1sizeof(query1), "SELECT * FROM Vehicles WHERE id = '%i'"); mysql_tquery(connectionquery1"LoadVehicle","d",i);

PHP Code:
forward LoadVehicle(id);
public 
LoadVehicle(id)
{
      
Vehicle[id][vModel] = cache_get_field_content_int(0"vModel");
      
Vehicle[id][vColor1] = cache_get_field_content_int(0"vColor1");
      
Vehicle[id][vColor2] = cache_get_field_content_int(0"vColor2");
      
Vehicle[id][vX] = cache_get_field_content_float(0"vX");
      
Vehicle[id][vY] = cache_get_field_content_float(0"vY");
      
Vehicle[id][vZ] = cache_get_field_content_float(0"vZ");
      
Vehicle[id][vA] = cache_get_field_content_float(0"vA");
      new 
owner[25];
      
cache_get_field_content(0"vOwner"owner);
        
myStrcpy(Vehicle[id][vOwner], owner);
        new 
sampid CreateVehicle(Vehicle[id][vModel], Vehicle[id][vX], Vehicle[id][vY], Vehicle[id][vZ], Vehicle[id][vA], Vehicle[id][vColor1], Vehicle[id][vColor2], -10);
         new 
enginelightsalarmdoorsbonnetbootobjective;
      
GetVehicleParamsEx(sampidenginelightsalarmdoorsbonnetbootobjective);
      
SetVehicleParamsEx(sampid0lightsalarmdoorsbonnetbootobjective);
      return 
1;

(And yes, the vehicle is already loaded, and the car id is equal to the mysql id.
justjamie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Doesn't get the vehicle name (+REP) [quick one] Lirbo Scripting Help 9 18/04/2016 12:14 PM
Somehow it doesn't put the player in a vehicle saffierr Scripting Help 3 08/09/2015 11:28 AM
How to reload a vehicle? SlonCHL Scripting Help 2 30/11/2013 10:15 AM
Bot doesn't enter to vehicle Shawwarma Scripting Help 2 14/05/2012 04:49 PM
Doesn't put me in the vehicle.. 0ne Help Archive 11 10/05/2010 11:33 AM


All times are GMT. The time now is 10:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.