unable to load
#1

PHP код:
------------------------------------------*/
#include <a_samp>
#include <a_mysql>
#include <sscanf2>
#include <zcmd>
#define MYSQL_HOST     "yea" 
#define MYSQL_USER     "yea"      
#define MYSQL_PASS     ""          
#define MYSQL_DATA     "yea" 
new DynamicCarID[MAX_VEHICLES], DynamicCar[MAX_VEHICLES], DynamicCarCol[MAX_VEHICLES][3];
new 
handle;
new 
VehicleNames[][] =
{
    
"Landstalker""Bravura""Buffalo""Linerunner""Perrenial""Sentinel",
    
"Dumper""Firetruck""Trashmaster""Stretch""Manana""Infernus",
    
"Voodoo""Pony""Mule""Cheetah""Ambulance""Leviathan""Moonbeam",
    
"Esperanto""Taxi""Washington""Bobcat""Whoopee""BF Injection",
    
"Hunter""Premier""Enforcer""Securicar""Banshee""Predator""Bus",
    
"Rhino""Barracks""Hotknife""Trailer""Previon""Coach""Cabbie",
    
"Stallion""Rumpo""RC Bandit""Romero""Packer""Monster""Admiral",
    
"Squalo""Seasparrow""Pizzaboy""Tram""Trailer""Turismo""Speeder",
    
"Reefer""Tropic""Flatbed""Yankee""Caddy""Solair""Berkley's RC Van",
    
"Skimmer""PCJ-600""Faggio""Freeway""RC Baron""RC Raider""Glendale",
    
"Oceanic","Sanchez""Sparrow""Patriot""Quad""Coastguard""Dinghy",
    
"Hermes""Sabre""Rustler""ZR-350""Walton""Regina""Comet""BMX",
    
"Burrito""Camper""Marquis""Baggage""Dozer""Maverick""News Chopper",
    
"Rancher""FBI Rancher""Virgo""Greenwood""Jetmax""Hotring""Sandking",
    
"Blista Compact""Police Maverick""Boxville""Benson""Mesa""RC Goblin",
    
"Hotring Racer A""Hotring Racer B""Bloodring Banger""Rancher""Super GT",
    
"Elegant""Journey""Bike""Mountain Bike""Beagle""Cropduster""Stunt",
    
"Tanker""Roadtrain""Nebula""Majestic""Buccaneer""Shamal""Hydra",
    
"FCR-900""NRG-500""HPV1000""Cement Truck""Tow Truck""Fortune",
    
"Cadrona""FBI Truck""Willard""Forklift""Tractor""Combine""Feltzer",
    
"Remington""Slamvan""Blade""Freight""Streak""Vortex""Vincent",
    
"Bullet""Clover""Sadler""Firetruck""Hustler""Intruder""Primo",
    
"Cargobob""Tampa""Sunrise""Merit""Utility""Nevada""Yosemite",
    
"Windsor""Monster""Monster""Uranus""Jester""Sultan""Stratium",
    
"Elegy""Raindance""RC Tiger""Flash""Tahoma""Savanna""Bandito",
    
"Freight Flat""Streak Carriage""Kart""Mower""Dune""Sweeper",
    
"Broadway""Tornado""AT-400""DFT-30""Huntley""Stafford""BF-400",
    
"News Van""Tug""Trailer""Emperor""Wayfarer""Euros""Hotdog""Club",
    
"Freight Box""Trailer""Andromada""Dodo""RC Cam""Launch""LSPD Cruiser",
    
"SFPD Cruiser""LVPD Cruiser""Police Ranger""Picador""S.W.A.T""Alpha",
    
"Phoenix""Glendale""Sadler""Luggage""Luggage""Stairs""Boxville",
    
"Tiller""Utility Trailer"
};
public 
OnFilterScriptInit()
{
    
mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_DATAMYSQL_PASS);
    print(
"\n--------------------------------------");
    print(
" Dynamic Vehicles by iGetty loaded");
    print(
"--------------------------------------\n");
    
LoadDynamicVehicles();
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"\n--------------------------------------");
    print(
" Dynamic Vehicles by iGetty unloaded");
    print(
"--------------------------------------\n");
    return 
1;
}
command(savecarplayeridparams[])
{
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
Float:xFloat:yFloat:zFloat:amod GetVehicleModel(GetPlayerVehicleID(playerid)), col1col2pl[9], vehicleid GetPlayerVehicleID(playerid), string[128];
            if(
sscanf(params"iis[8]"col1col2pl))return SendClientMessage(playerid, -1"Usage: /savecar [colour 1] [colour 2] [plate]");
            {
                if(
strlen(pl) > 8)return SendClientMessage(playerid, -1"The vehicles plate must be less than 8 characters long.");
                
GetVehiclePos(vehicleidxyz);
                
GetVehicleZAngle(vehicleida);
                
SaveDynamicVehicle(xyzamodcol1col2pl);
                
SetVehicleNumberPlate(vehicleidpl);
                
SetVehicleToRespawn(vehicleid);
                
SetVehiclePos(vehicleidxyz);
                
SetVehicleZAngle(vehicleida);
                
ChangeVehicleColor(vehicleidcol1col2);
                
format(stringsizeof(string), "You have saved this %s to the database. Colours: %s and %s, license plate: %s."GetVehicleName(vehicleid), GetVehicleColorName(col1), GetVehicleColorName(col2), pl);
                
SendClientMessage(playerid, -1string);
            }
        }
        else return 
SendClientMessage(playerid, -1"You must be the driver of this vehicle to save it to the database.");
    }
    else return 
SendClientMessage(playerid, -1"You must be inside of a vehicle to save it to the database.");
    return 
1;
}
stock SaveDynamicVehicle(Float:xFloat:yFloat:zFloat:amodc1c2plate[])
{
    new 
Query[512];
    
format(Querysizeof(Query), "INSERT INTO `sasdvehicles` (model, x, y, z, a, c1, c2, plate) VALUES(%d, %f, %f, %f, %f, %i, %i, '%s')",
    
modxyzac1c2plate);
    
mysql_tquery(handleQuery"""");
    
mysql_free_result();
    return 
1;
}
stock LoadDynamicVehicles()
{
    new 
Str[128], VehicleIDVehicleModelFloat:VehicleXFloat:VehicleYFloat:VehicleZFloat:VehicleACol1Col2vehPlate[10], 0;
    new 
query[256];
    
format(querysizeof(query), "SELECT * FROM `sasdvehicles`");
    
mysql_tquery(handlequery"""");
    
mysql_store_result();
    if(
mysql_num_rows() != 0)
    {
        while(
mysql_fetch_row(Str))
        {
            
sscanf(Str"p<|>iiffffiis[10]"VehicleIDVehicleModelVehicleXVehicleYVehicleZVehicleACol1Col2vehPlate);
            
CreateVehicle(VehicleModelVehicleXVehicleYVehicleZVehicleACol1Col2, -1);
            
SetVehicleNumberPlate(ivehPlate);
            
SetVehicleToRespawn(i);
            
DynamicCarID[i] = VehicleID;
            
DynamicCarCol[i][1] = Col1;
            
DynamicCarCol[i][2] = Col2;
            
DynamicCar[i] = 1;
            
i++;
        }
    }
    
mysql_free_result();
    
printf("--- %i vehicles loaded from the MySQL Database. ---"i);
    return 
1;
}
stock GetVehicleName(vehicleid)
{
    new 
String[28];
    
format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
    return 
String;
}
stock GetVehicleColorName(color)
{
    new 
clr[32];
    switch(
color)
    {
        case 
0clr ="Black";
        case 
1clr ="White";
        case 
2clr ="Blue";
        case 
3clr ="Red";
        case 
4clr ="Grey-Green";
        case 
5clr ="Purple";
        case 
6clr ="Yellow";
        case 
7clr ="Blue";
        case 
8clr ="Silver";
        case 
9clr ="Dark sGrey";
        case 
10clr ="Midnight Blue";
        case 
11clr ="Dark Grey";
        case 
12clr ="Teal";
        case 
13clr ="Dark Grey";
        case 
14clr ="Light Grey";
        case 
15clr ="Silver";
        case 
16clr ="Dark Green";
        case 
17clr ="Dark Red";
        case 
18clr ="Dark Red";
        case 
19clr ="Grey";
        case 
20clr ="Royal Blue";
        case 
21clr ="Rich Maroon";
        case 
22clr ="Rich Maroon";
        case 
23clr ="Grey";
        case 
24clr ="Dark Grey";
        case 
25clr ="Dark Grey";
        case 
26clr ="Light Grey";
        case 
27clr ="Grey";
        case 
28clr ="Midnight Blue";
        case 
29clr ="Light Grey";
        case 
30clr ="Dark Maroon";
        case 
31clr ="Red";
        case 
32clr ="Baby Blue";
        case 
33clr ="Grey";
        case 
34clr ="Grey";
        case 
35clr ="Dark Grey";
        case 
36clr ="Dark Grey";
        case 
37clr ="";
        case 
38clr ="Tea Green";
        case 
39clr ="Steel blue";
        case 
40clr ="Black";
        case 
41clr ="Light Brown";
        case 
42clr ="Bright Maroon";
        case 
43clr ="Maroon";
        case 
44clr ="Myrtle Green";
        case 
45clr ="Maroon";
        case 
46clr ="Olive Green";
        case 
47clr ="Olive";
        case 
48clr ="Khaki Brown";
        case 
49clr ="Light Grey";
        case 
50clr ="Silver Grey";
        case 
51clr ="Dark Green";
        case 
52clr ="Dark Teal";
        case 
53clr ="Navy Blue";
        case 
54clr ="Navy Blue";
        case 
55clr ="Brown";
        case 
56clr ="Light Grey";
        case 
57clr ="Beige";
        case 
58clr ="Maroon";
        case 
59clr ="Grey-Blue";
        case 
60clr ="Grey";
        case 
61clr ="Old Gold";
        case 
62clr ="Maroon";
        case 
63clr ="Grey";
        case 
64clr ="Grey";
        case 
65clr ="Old Gold";
        case 
66clr ="Dark Brown";
        case 
67clr ="Light Blue";
        case 
68clr ="Light Khaki";
        case 
69clr ="Light Pink";
        case 
70clr ="Bright Maroon";
        case 
71clr ="Light Blue";
        case 
72clr ="Grey";
        case 
73clr ="Tea Green";
        case 
74clr ="Dark Maroon";
        case 
75clr ="Dark Blue";
        case 
76clr ="Light Brown";
        case 
77clr ="Ecru Brown";
        case 
78clr ="Maroon";
        case 
79clr ="Royal Blue";
        case 
80clr ="Rich Maroon";
        case 
81clr ="Light Brown";
        case 
82clr ="Bright Maroon";
        case 
83clr ="Dark Teal Green";
        case 
84clr ="Brown";
        case 
85clr ="Rich Maroon";
        case 
86clr ="Green";
        case 
87clr ="Blue ";
        case 
88clr ="Maroon";
        case 
89clr ="Beige";
        case 
90clr ="Grey";
        case 
91clr ="Dark Blue";
        case 
92clr ="Grey";
        case 
93clr ="Sky Blue";
        case 
94clr ="Blue";
        case 
95clr ="Navy Blue";
        case 
96clr ="Silver";
        case 
97clr ="Light Blue";
        case 
98clr ="Grey";
        case 
99clr ="Light Brown ";
        case 
100clr ="Blue";
        case 
101clr ="Dark Blue";
        case 
102clr ="Light Brown";
        case 
103clr ="Blue";
        case 
104clr ="Brown";
        case 
105clr ="Dark Grey";
        case 
106clr ="Blue";
        case 
107clr ="Light Brown";
        case 
108clr ="Yale Blue";
        case 
109clr ="Dark Grey";
        case 
110clr ="Brown";
        case 
111clr ="Light Grey";
        case 
112clr ="Blue";
        case 
113clr ="Brown";
        case 
114clr ="Dark Grey";
        case 
115clr ="Dark Red";
        case 
116clr ="Navy Blue";
        case 
117clr ="Dark Maroon";
        case 
118clr ="Light Blue";
        case 
119clr ="Brown";
        case 
120clr ="Light Brown";
        case 
121clr ="Dark Maroon";
        case 
122clr ="Grey";
        case 
123clr ="Brown";
        case 
124clr ="Rich Maroon";
        case 
125clr ="Dark Blue";
        case 
126clr ="Pink";
    }
    return 
clr;

i have 15 vehicles on the database but loads 0 IG
Reply
#2

Does someone know why?
Reply
#3

uphelp me
Reply
#4

what version of mysql you use?
Reply
#5

R33 a_Mysql
Reply
#6

hmm, i dont use this version but try to change this,

Quote:

stock LoadDynamicVehicles()
{
new Str[128], VehicleID, VehicleModel, Float:VehicleX, Float:VehicleY, Float:VehicleZ, Float:VehicleA, Col1, Col2, vehPlate[10], i = 0;



new query[256];
format(query, sizeof(query), "SELECT * FROM `sasdvehicles`");
mysql_tquery(handle, query, "", ""); to mysql_query(handle, query);
mysql_store_result();

if this dont work try to update to the new version of mysql or r39, and use cache is much better
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)