GetItemAmount(playerid,itemname[]){format(query,sizeof(query),\"SELECT ItemAmount FROM items WHERE ItemName = \'%s\'\",itemname);mysql_query(SQL,query);new darab = cache_get_field_content_int(0,\"ItemAmount\");return darab;}
GetItemAmount(playerid,itemname[]){format(query,sizeof(query),\"SELECT ItemAmount FROM items WHERE ItemName = \'%s\'\",itemname);mysql_query(SQL,query);new darab = mysql_store_result(); mysql_free_result();return darab;}
public GetItemAmountCallback // Etc.
GetItemAmount(playerid,itemname[]) { format(query,sizeof(query),\"SELECT ItemAmount FROM items WHERE ItemName = \'%s\'\",itemname); new Cache:result = mysql_query(SQL,query); new darab = cache_num_rows(); cache_delete(result); return darab; }
cache_num_rows();
stock GetItemAmount(itemname[]){new query[128];format(query,sizeof(query),\"SELECT ItemAmount FROM itemss WHERE ItemName = \'%s\'\",itemname);new Cache:result = mysql_query(SQL,query);new darab = cache_get_field_content_int(0,\"ItemAmount\");cache_delete(result);return darab;}
TargyObjekt(nev[]){format(query,sizeof(query),\"SELECT * FROM targylista WHERE TargyNev = \'%s\'\",nev);new Cache:eredmeny = mysql_query(SQL,query);new objekt = cache_get_field_content_int(0,\"TargyObjekt\");cache_delete(eredmeny);return objekt;}
public EldobottTargyakBetoltese(){new sorok = cache_get_row_count();if(sorok){new id,targynev[64],darab,Float:pos[3],vilag[2];for(new i = 0; i < sorok; i++){ cache_get_field_content(i,\"TargyNev\",targynev,SQL,64); id = cache_get_field_content_int(i,\"TargyID\"); darab = cache_get_field_content_int(i,\"TargyDarab\"); pos[0] = cache_get_field_content_float(i,\"X\"); pos[1] = cache_get_field_content_float(i,\"Y\"); pos[2] = cache_get_field_content_float(i,\"Z\"); vilag[0] = cache_get_field_content_int(i,\"VW\"); vilag[1] = cache_get_field_content_int(i,\"Inti\"); EldobottTargyObjekt[id] = CreateDynamicObject(TargyObjekt(targynev),pos[0],pos[1],pos[2],0,0,0,vilag[0],vilag[1]); new string[128]; format(string,sizeof(string),\"\"SZ_SZURKE\"[ Eldobott tárgy ]\\nTárgy : %s\\nDarab : %d\",targynev,darab); EldobottTargyLabel[id] = CreateDynamic3DTextLabel(string,-1,pos[0],pos[1],pos[2],20,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,vilag[0],vilag[1]);}printf(\"[ - ] %d darab eldobott tárgy betöltve ! [ - ]\",sorok);}}
EldobottTargyObjekt[id] = CreateDynamicObject(TargyObjekt(targynev),pos[0],pos[1],pos[2],0,0,0,vilag[0],vilag[1]);
SELECT targylista.TargyObjekt,eldobottargyak.* FROM targylista,eldobottargyak
objectid = cache_get_field_content_int(i,\"TargyObjekt\");
SELECT targylista.TargyObjekt,targylista.TargyNev,eldobottargyak.* FROM targylista,eldobottargyak
public EldobottTargyakBetoltese(){new sorok = cache_get_row_count();if(sorok){new Cache:betoltes;new id,targynev[64],darab,Float:pos[3],vilag[2];for(new i = 0; i < sorok; i++){ betoltes = cache_save(); cache_get_field_content(i,\"TargyNev\",targynev,SQL,64); id = cache_get_field_content_int(i,\"TargyID\"); darab = cache_get_field_content_int(i,\"TargyDarab\"); pos[0] = cache_get_field_content_float(i,\"X\"); pos[1] = cache_get_field_content_float(i,\"Y\"); pos[2] = cache_get_field_content_float(i,\"Z\"); vilag[0] = cache_get_field_content_int(i,\"VW\"); vilag[1] = cache_get_field_content_int(i,\"Inti\"); EldobottTargyObjekt[id] = CreateDynamicObject(TargyObjekt(targynev),pos[0],pos[1],pos[2],0,0,0,vilag[0],vilag[1]); new string[128]; format(string,sizeof(string),\"\"SZ_SZURKE\"[ Eldobott tárgy ]\\nTárgy : %s\\nDarab : %d\",targynev,darab); EldobottTargyLabel[id] = CreateDynamic3DTextLabel(string,-1,pos[0],pos[1],pos[2],20,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,vilag[0],vilag[1]); cache_set_active(betoltes); }cache_delete(betoltes);printf(\"[ - ] %d darab eldobott tárgy betöltve ! [ - ]\",sorok);}}
new Cache:betoltes;betoltes = cache_save();cache_set_active(betoltes); cache_delete(betoltes);