Error in LoadOrg stock
#1

Lately, I have been creating a dynamic faction system which doesn't load the org. There are no errors in the script. Here is a debug code.

By the way, we can organizations/orgs instead of faction.

Код:
[10:22:31] CMySQLHandler::Query(SELECT * FROM `orgs` WHERE `ID` = '1') - Successfully executed.

[10:22:31] >> mysql_num_rows( Connection handle: 1 )

[10:22:31] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(X) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(Y) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(Z) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(INTERIOR) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(NAME) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(COLOR) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(LEADER) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(SKIN1) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(SKIN2) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(SKIN3) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(WEAPON1) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(WEAPON2) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(WEAPON3) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:31] >> mysql_fetch_field_row( Connection handle: 1 )

[10:22:31] CMySQLHandler::FetchField(BANK) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[10:22:56] >> mysql_query( Connection handle: 1 )
And this conflicts in the stock LoadOrgs

Here's the code.

pawn Код:
stock LoadOrgs()
{
    new id = 1;
    while(id < MAX_ORGS)
    {
        format(Query,sizeof(Query),"SELECT * FROM `orgs` WHERE `ID` = '%d'",id);
        mysql_query(Query);
        if(mysql_num_rows())
        {
           
            mysql_fetch_field_row(data,"X");
            OrgInfo[id][oX] = floatstr(data);
            mysql_fetch_field_row(data,"Y");
            OrgInfo[id][oY] = floatstr(data);
            mysql_fetch_field_row(data,"Z");
            OrgInfo[id][oZ] = floatstr(data);
            mysql_fetch_field_row(data,"INTERIOR");
            OrgInfo[id][oInt] = strval(data);
            mysql_fetch_field_row(data,"NAME");
            format(OrgInfo[id][oName],128,"%s",data);
            mysql_fetch_field_row(data,"COLOR");
            format(OrgInfo[id][oColor],11,"%s",data);
            mysql_fetch_field_row(data,"LEADER");
            format(OrgInfo[id][oLeader],24,"%s",data);
            mysql_fetch_field_row(data,"SKIN1");
            OrgInfo[id][oSkin][0] = strval(data);
            mysql_fetch_field_row(data,"SKIN2");
            OrgInfo[id][oSkin][1] = strval(data);
            mysql_fetch_field_row(data,"SKIN3");
            OrgInfo[id][oSkin][2] = strval(data);
            mysql_fetch_field_row(data,"WEAPON1");
            OrgInfo[id][oWeapon][0] = strval(data);
            mysql_fetch_field_row(data,"WEAPON2");
            OrgInfo[id][oWeapon][1] = strval(data);
            mysql_fetch_field_row(data,"WEAPON3");
            OrgInfo[id][oWeapon][2] = strval(data);
            mysql_fetch_field_row(data,"BANK");
            OrgInfo[id][oBank] = strval(data);
            CreateOrg(OrgInfo[id][oX],OrgInfo[id][oY],OrgInfo[id][oZ],OrgInfo[id][oInt],OrgInfo[id][oName],OrgInfo[id][oColor],OrgInfo[id][oWeapon][0],OrgInfo[id][oWeapon][1],OrgInfo[id][oWeapon][2],OrgInfo[id][oSkin][0],OrgInfo[id][oSkin][1],OrgInfo[id][oSkin][2],OrgInfo[id][oType]);
            return 1;
        }
        id++;
    }
    mysql_free_result();
    return 1;
}
I can provide what ever code is needed.
Reply


Messages In This Thread
Error in LoadOrg stock - by Tayab - 21.12.2013, 18:07
Re: Error in LoadOrg stock - by Konstantinos - 21.12.2013, 18:10
Re: Error in LoadOrg stock - by Tayab - 21.12.2013, 18:26
Re: Error in LoadOrg stock - by Patrick - 21.12.2013, 18:30
Re: Error in LoadOrg stock - by Tayab - 23.12.2013, 14:28

Forum Jump:


Users browsing this thread: 1 Guest(s)