SetVehicleNumberPlate - mySQL Help
#1

I'm having a problem, where by my numberplate is not showing correctly, hoping you guys can help.

The vPlate value in my database is: YME 161
(That's the plate, that should be shown)

Here is the code that does all the work..
Код:
    new result[24], index = 0;
    mysql_query("SELECT * FROM `server_vehicles`");
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_get_field("vPlate", Vehicles[index][vPlate]);
        printf("Plate1: %s", Vehicles[index][vPlate]);

        mysql_get_field("vModelID", result);
        Vehicles[index][vModelID] = strval(result);

        mysql_get_field("vPositionX", result);
        Vehicles[index][vPositionX] = floatstr(result);
        
        mysql_get_field("vPositionY", result);
        Vehicles[index][vPositionY] = floatstr(result);
        
        mysql_get_field("vPositionZ", result);
        Vehicles[index][vPositionZ] = floatstr(result);
        
        mysql_get_field("vAngleZ", result);
        Vehicles[index][vAngleZ] = floatstr(result);
        
        mysql_get_field("Color1", result);
        Vehicles[index][vColor1] = strval(result);
        
        mysql_get_field("Color2", result);
        Vehicles[index][vColor2] = strval(result);

        SetVehicleNumberPlate(CreateVehicle(Vehicles[index][vModelID], Vehicles[index][vPositionX], Vehicles[index][vPositionY], Vehicles[index][vPositionZ], Vehicles[index][vAngleZ], Vehicles[index][vColor1], Vehicles[index][vColor2], -1), Vehicles[index][vPlate]);
    }
printf on the server log displays the plate is should: "Plate1: YME 161"

Although, when I go onto the server the numberplate shows as:

http://s4.postimage.org/nc9l9d4j2/sa_mp_005.png

Any help? This is driving me crazy.
Reply
#2

pawn Код:
new result[24], index = 0;
    mysql_query("SELECT * FROM `server_vehicles`");
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_get_field("vPlate", Vehicles[index][vPlate]);
        printf("Plate1: %s", Vehicles[index][vPlate]);

        mysql_get_field("vModelID", result);
        Vehicles[index][vModelID] = strval(result);

        mysql_get_field("vPositionX", result);
        Vehicles[index][vPositionX] = floatstr(result);
       
        mysql_get_field("vPositionY", result);
        Vehicles[index][vPositionY] = floatstr(result);
       
        mysql_get_field("vPositionZ", result);
        Vehicles[index][vPositionZ] = floatstr(result);
       
        mysql_get_field("vAngleZ", result);
        Vehicles[index][vAngleZ] = floatstr(result);
       
        mysql_get_field("Color1", result);
        Vehicles[index][vColor1] = strval(result);
       
        mysql_get_field("Color2", result);
        Vehicles[index][vColor2] = strval(result);

        new vehicleid = CreateVehicle(Vehicles[index][vModelID], Vehicles[index][vPositionX], Vehicles[index][vPositionY], Vehicles[index][vPositionZ], Vehicles[index][vAngleZ], Vehicles[index][vColor1], Vehicles[index][vColor2], -1);
       
        SetVehicleNumberPlate(vehicleid, Vehicles[index][vPlate]);
        index++;
    }
Reply
#3

The issue is unfortunately still persisting.
Reply
#4

Use sscanf to split query.
Reply
#5

Not sure how to use sscanf, could you help me write it for the Vehicle System, like I posted above?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)