Hey Leute, ich habe ein Problem und zwar bekomme ich es nicht hin ein String aus der Mysql Datenbank auszulesen da kommt immer
hier der abschnitt aus dem Script
Code
public OnFrakLoad()
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new string[128],tmp[70];
new id=getFreeFrakID();
fInfo[id][f_x] = cache_get_field_content_float(i,"x",dbhandle);
fInfo[id][f_y] = cache_get_field_content_float(i,"y",dbhandle);
fInfo[id][f_z] = cache_get_field_content_float(i,"z",dbhandle);
fInfo[id][f_r] = cache_get_field_content_float(i,"r",dbhandle);
fInfo[id][f_money] = cache_get_field_content_int(i,"GangKasse",dbhandle);
fInfo[id][f_id] = cache_get_field_content_int(i,"id",dbhandle);
fInfo[id][f_wteil] = cache_get_field_content_int(i,"Waffenlager",dbhandle);
fInfo[id][f_spice] = cache_get_field_content_int(i,"Spicelager",dbhandle);
new tmp_name[128];
cache_get_field_content(i, "besitzer", tmp_name, dbhandle);
format(tmp,70,"%s",tmp_name);
CreatePickup(1273, 0,fInfo[id][f_x],fInfo[id][f_y],fInfo[id][f_z], -1);
format(string,128,"Name:%s\nMoney:%i$\nID:%i",tmp,fInfo[id][f_money],fInfo[id][f_id]);
Create3DTextLabel(string,GRÜN,fInfo[id][f_x],fInfo[id][f_y],fInfo[id][f_z],fInfo[id][f_r],0,0);
}
return 1;
}
public OnGameModeInit()
{
SetGameModeText("First-Roleplay");
AddPlayerClass(1,199.0846,-150.0331,1.5781,359.1443,WEAPON_MP5,500,0,0,0,0);
for(new i=0; i<sizeof(buyauto); i++)
{
buyauto[i][id_x] = AddStaticVehicle(buyauto[i][model],buyauto[i][s_x],buyauto[i][s_y],buyauto[i][s_z],buyauto[i][s_r],-1,-1);
}
dbhandle = mysql_connect(db_host,db_user,db_db,db_pass);
ManualVehicleEngineAndLights();
//Fraktion
loadFraktion();
return 1;
}
loadFraktion()
{
new query[128];
format(query,sizeof query,"SELECT * FROM fraktion");
mysql_function_query(dbhandle,query,true,"OnFrakLoad","");
return 1;
}
Alles anzeigen