stock VehicleLoad(vehicleID)
{
new Query1[200], DBResult: Result1;
format(Query1, sizeof(Query1), "SELECT * FROM `VEHICLES` WHERE `ID` = %d LIMIT 1", vehicleID);
Result1 = db_query(survival, Query1);
if(db_num_rows(Result1))
{
new Field1[20];
db_get_field_assoc(Result1, "FUEL", Field1, 30);
VehicleInfo[vehicleID][vFuel] = strval(Field1);
db_get_field_assoc(Result1, "MODEL", Field1, 30);
VehicleInfo[vehicleID][vModel] = strval(Field1);
db_get_field_assoc(Result1, "COLOR1", Field1, 30);
VehicleInfo[vehicleID][vCol1] = strval(Field1);
db_get_field_assoc(Result1, "COLOR2", Field1, 30);
VehicleInfo[vehicleID][vCol2] = strval(Field1);
db_get_field_assoc(Result1, "ID", Field1, 30);
VehicleInfo[vehicleID][vID] = strval(Field1);
db_get_field_assoc(Result1, "SPAWNX", Field1, 30);
VehicleInfo[vehicleID][vSpawnX] = floatstr(Field1);
db_get_field_assoc(Result1, "SPAWNY", Field1, 30);
VehicleInfo[vehicleID][vSpawnY] = floatstr(Field1);
db_get_field_assoc(Result1, "SPAWNZ", Field1, 30);
VehicleInfo[vehicleID][vSpawnZ] = floatstr(Field1);
db_get_field_assoc(Result1, "SPAWNA", Field1, 30);
VehicleInfo[vehicleID][vSpawnA] = floatstr(Field1);
print(Query1);
}
db_free_result(Result1);
CreateVehicle(VehicleInfo[vehicleID][vModel], VehicleInfo[vehicleID][vSpawnX], VehicleInfo[vehicleID][vSpawnY], VehicleInfo[vehicleID][vSpawnZ], VehicleInfo[vehicleID][vSpawnA], VehicleInfo[vehicleID][vCol1], VehicleInfo[vehicleID][vCol2], 999999);
}
ONPLAYERCONNECT:
GetPlayerName(playerid, name, sizeof(name));
format(Query, sizeof(Query), "SELECT `NAME` FROM `ACCOUNTS` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(name));
Result = db_query(survival, Query);
if(db_num_rows(Result))
{
new loginstring[100];
format(loginstring, sizeof(loginstring), "Welcome back!\n{00FF00}Username: {FFFFFF}%s\nEnter your password below\nto get playing!", name);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", loginstring, "Login", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Register","Your account is not registered.\nPlease create a password and click register!","Register","Quit");
}
db_free_result(Result);
return 1;
}
I don't see any similarities between those two that can cause it. Are you sure it's inserted when you register?
None. It's build-in in SA-MP. How would that affect it? It also needs to be set but when you create the table, only once is fine instead of using it in every query you use the player's name. |
Result = db_query(survival, Query);
if(db_num_rows(Result))