Could someone help me decipher this a little?
#3

pawn Код:
stock GetWepIndexFromSQL(weapid)//returns the INDEX of the serverside database (PlayerWeapons[playerid][w] by giving the SQLID as parameter
{//needed when using WepVARIABLES
    new rst = -1;
    new string[40];
    format(string, sizeof(string), "SELECT `id` FROM `weapons`");
    mysql_query(string);
    mysql_store_result();
    new maxr = mysql_num_rows();
    mysql_free_result();
    for(new n=0; n<maxr; n++)
    {
        if(weapid == WepSQLID[n])   //at this point ==> weapid is the SQLID we have from PlayerWeapons
        {//and WepSQLID[n] is the SQL ID that is stored in the serverside table... n is the specific index (the number
            rst = n;//that we need)... Ahh. But if PlayerWeapons stores the SQLID? PlayerWeapons stores the SQLID, I don't
            break;// get your question:D
        }
    }
    return rst;
}
Reply


Messages In This Thread
Could someone help me decipher this a little? - by Dokins - 29.11.2014, 15:46
Re: Could someone help me decipher this a little? - by Raweresh - 29.11.2014, 16:52
Re: Could someone help me decipher this a little? - by Dokins - 29.11.2014, 17:20
Re: Could someone help me decipher this a little? - by sammp - 29.11.2014, 17:30
Re: Could someone help me decipher this a little? - by Dokins - 29.11.2014, 17:38
Re: Could someone help me decipher this a little? - by PT - 29.11.2014, 17:45
Re: Could someone help me decipher this a little? - by Dokins - 29.11.2014, 18:24
Re: Could someone help me decipher this a little? - by sammp - 29.11.2014, 19:22

Forum Jump:


Users browsing this thread: 1 Guest(s)