14.03.2012, 18:53
Try this:
pawn Код:
ReadVehicle(playerid);
public ReadVehicle(playerid)
{
new query[256],string[128];
new DBResult:qresult;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
//SELECT vehicleinfo FROM vehicleinfo WHERE username = '%s' AND slotid = %d", pname, slotid);
//format(string,sizeof(string),"SELECT Level FROM `users` WHERE Username = '%s'", PlayerName[playerid]);
//format(query,sizeof(query),"SELECT stat FROM `Users` WHERE `Name`= '%s'",pName);
//format(query,sizeof(query),"SELECT Name FROM `Users` WHERE `Name`= '%s'",pName);
//format(query, sizeof(query), "SELECT Users FROM Users WHERE name = '%s'",pName);
format(query, sizeof(query), "SELECT Users FROM `Users` WHERE name = '%s'",pName);
qresult = db_query(testdb,query);
//if(db_num_rows(qresult) == 1)
// {
db_get_field_assoc(qresult,"name",string,6);
format(string,sizeof(string),"%s",strval(string));
SendClientMessage(playerid,0xAFAFAFAA,string);
//}
db_free_result(qresult);
}