Mysql Loading Help ! [+rep]
#6

[QUOTE=Misiur;3400729]Well, if you want to manage atm's from let's say website, sql is a good choice (though it's not impossible with files, but a little inconvinient).

pawn Code:
while(i < rows)
    {
        cache_get_field_content(i, "VW", tmp, MainPipeline); ATM[i][atmVW] = strval(tmp);
        cache_get_field_content(i, "Int", tmp, MainPipeline); ATM[i][atmInt] = strval(tmp);
        cache_get_field_content(i, "Modelz", tmp, MainPipeline); ATM[i][atmModelz] = strval(tmp);
        cache_get_field_content(i, "PosX", tmp, MainPipeline); ATM[i][atmPosX] = floatstr(tmp);
        cache_get_field_content(i, "PosY", tmp, MainPipeline); ATM[i][atmPosY] = floatstr(tmp);
        cache_get_field_content(i, "PosZ", tmp, MainPipeline); ATM[i][atmPosZ] = floatstr(tmp);
        cache_get_field_content(i, "Angle", tmp, MainPipeline); ATM[i][atmAngle] = floatstr(tmp);
    }
        RenderATM(i);
          i++;
I've made it , it compilied with 0 warns and everything looks fine but when i restart the server i didn't see any atm and i did /gotoatm and it said
PHP Code:
    if(ATM[id][atmPosX] == 0.0) {
        return 
SendClientMessageEx(playeridCOLOR_GRAD2"No atms found with that ID."); 
and i refreashed the mysql and the pos.. changed when i /createatm that means that its saving fine but the loading is destroyed.

Loading ..

PHP Code:
stock LoadATMS()
{
    
printf("[LoadAtms] Loading data from database...");
    
mysql_function_query(MainPipeline"SELECT * FROM `atms`"true"OnLoadAtms""");

AND onloadatms

PHP Code:
forward OnLoadATMS();
public 
OnLoadATMS()
{
    new 
irowsfieldstmp[128];
    
cache_get_data(rowsfieldsMainPipeline);
    while(
rows)
    {
        
cache_get_field_content(i"VW"tmpMainPipeline); ATM[i][atmVW] = strval(tmp);
        
cache_get_field_content(i"Int"tmpMainPipeline); ATM[i][atmInt] = strval(tmp);
        
cache_get_field_content(i"Modelz"tmpMainPipeline); ATM[i][atmModelz] = strval(tmp);
        
cache_get_field_content(i"PosX"tmpMainPipeline); ATM[i][atmPosX] = floatstr(tmp);
        
cache_get_field_content(i"PosY"tmpMainPipeline); ATM[i][atmPosY] = floatstr(tmp);
        
cache_get_field_content(i"PosZ"tmpMainPipeline); ATM[i][atmPosZ] = floatstr(tmp);
        
cache_get_field_content(i"Angle"tmpMainPipeline); ATM[i][atmAngle] = floatstr(tmp);
        
RenderATM(i);
        
i++;
    }
    if(
0printf("[LoadATMS] %d houses rehashed/loaded."i);
    else 
printf("[LoadATMS] Failed to load any houses.");

Reply


Messages In This Thread
Mysql Loading Help ! [+rep] - by MoemenWalid - 12.03.2015, 15:38
Re : Mysql Loading Help ! [+rep] - by Golimad - 12.03.2015, 15:44
Re: Mysql Loading Help ! [+rep] - by MoemenWalid - 12.03.2015, 15:54
Re: Mysql Loading Help ! [+rep] - by Misiur - 12.03.2015, 15:58
Respuesta: Mysql Loading Help ! [+rep] - by CuervO - 12.03.2015, 16:23
Re: Mysql Loading Help ! [+rep] - by MoemenWalid - 12.03.2015, 16:24
Re: Mysql Loading Help ! [+rep] - by Misiur - 12.03.2015, 16:28
Re: Respuesta: Mysql Loading Help ! [+rep] - by MoemenWalid - 12.03.2015, 16:43

Forum Jump:


Users browsing this thread: 1 Guest(s)