28.09.2010, 23:42
I have been trying many diffrent way to convert this code to mysql but i just haven't found a way, I get it to work but it dosen't load as it's suppose to. It just shows blank info. A little help on how to convert this to mysql?
This is OnplayerConnect, Basically what it does is if you own a vehicle it loads them. If you don't own a vehicle it sets all your vehicles to "None"
Oh and sscanf2 if possible
pawn Код:
format(str, sizeof(str), "Vehicles/Players/%s.cfg", plname);
if(dini_Exists(str))
{
strmid(PlayerVehicle[playerid][pVeh1], dini_Get(str, "Vehicle1"), 0, strlen(dini_Get(str, "Vehicle1")), 255);
strmid(PlayerVehicle[playerid][pVeh2], dini_Get(str, "Vehicle2"), 0, strlen(dini_Get(str, "Vehicle2")), 255);
strmid(PlayerVehicle[playerid][pVeh3], dini_Get(str, "Vehicle3"), 0, strlen(dini_Get(str, "Vehicle3")), 255);
strmid(PlayerVehicle[playerid][pVeh4], dini_Get(str, "Vehicle4"), 0, strlen(dini_Get(str, "Vehicle4")), 255);
strmid(PlayerVehicle[playerid][pVeh5], dini_Get(str, "Vehicle5"), 0, strlen(dini_Get(str, "Vehicle5")), 255);
return 1;
}
else
{
dini_Create(str);
strmid(PlayerVehicle[playerid][pVeh1], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh2], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh3], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh4], "None", 0, strlen("None"), 255);
strmid(PlayerVehicle[playerid][pVeh5], "None", 0, strlen("None"), 255);
//return 1;
}
Oh and sscanf2 if possible