Guest User

Untitled

a guest
Dec 16th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.17 KB | None | 0 0
  1. public TQuery_GetPropsList(Handle:owner, Handle:hndl, const String:error[], any:data)
  2. {
  3.     if (hndl != INVALID_HANDLE)
  4.     {
  5.         new id;
  6.         new cat_id;
  7.         g_iTotalProp = 0;
  8.         // decl String:categorie_name[128];
  9.         while (SQL_FetchRow(hndl))
  10.         {
  11.             g_iTotalProp++;
  12.  
  13.             id =        SQL_FetchInt(hndl, 0);
  14.             cat_id =    SQL_FetchInt(hndl, 1);
  15.             g_PropList[id][categorie_id] = cat_id;
  16.            
  17.             // SQL_FetchString(hndl, 1, g_PropList[id][categorie_prop],     NAME_MAXLEN);
  18.            
  19.             SQL_FetchString(hndl, 2, g_PropList[id][nom_prop],          NAME_MAXLEN);
  20.             SQL_FetchString(hndl, 3, g_PropList[id][chemin_prop],       PATH_MAXLEN);
  21.             g_PropList[id][prix_prop] = SQL_FetchInt(hndl, 4);
  22.             if (!IsModelPrecached(g_PropList[id][chemin_prop]))
  23.                 PrecacheModel(g_PropList[id][chemin_prop], true);
  24.                
  25.            
  26.             if (StrEqual(g_Categories[cat_id][Categorie_Name], ""))
  27.             {
  28.                 g_iTotalCategorie++;
  29.                 SQL_FetchString(hndl, 5, g_Categories[cat_id][Categorie_Name], MAX_CATEGORIE_NAME);
  30.             }
  31.             g_Categories[cat_id][Categorie_Total_Prop]++;
  32.  
  33.         }      
  34.        
  35.         PrintToServer("%s Un total de %d props charges", LOGO, g_iTotalProp);
  36.        
  37.     }
  38.     else
  39.         LogError("%s Impossible de recuperer le liste des props", LOGO);
  40. }
Add Comment
Please, Sign In to add comment