AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weird....SQL.... (https://forums.alliedmods.net/showthread.php?t=25854)

mysticssjgoku4 03-21-2006 21:11

Weird....SQL....
 
Alright there again. Hello.

I'm currently converting over Harbu's RP plugins to 1.7, and it's been a success so far, there is only one problem.

Code:
new query[256], npc_origin[3], npcid, hardcode         format(query,255,"SELECT npcid,x,y,z,hardcode FROM npc")         result = dbi_query(dbc,"%s",query)         if(result >= RESULT_OK)         {               new rows = dbi_num_rows(result)             for( new i = 0; i < rows; i++)             {                 dbi_nextrow(result)                                 npcid = dbi_field(result,1)                 npc_origin[0] = dbi_field(result,2)                 npc_origin[1] = dbi_field(result,3)                 npc_origin[2] = dbi_field(result,4)                 hardcode = dbi_field(result,5)                                 if(get_distance(origin,npc_origin) <= 25.0)                 {                     if(hardcode == 1)                     {                         Bank_Npc(id)                         break                     } else if(hardcode == 2)                         {                             prodigy(id)                             break                         } else if(hardcode == 0)                             {                                 shop_options(id,npcid)                                 break                                                             }                 }             }             dbi_free_result(result)         }


That returns an error on the free_result after I use the /buy command at a counter.
Any particular reason you can spot out why that would occur?

Thanks.

Brad 03-21-2006 21:17

What is the error?

mysticssjgoku4 03-21-2006 21:38

Invalid Result Handle -1
Run time error 10: native error <native "dbi_free_result">
HarbuRPAlpha.sma::buystuff <line 3320>

Line 3320:
Code:
dbi_free_result(result)

Xanimos 03-21-2006 21:49

And you are sure that is the exact code that is around that line?

mysticssjgoku4 03-21-2006 21:54

Yes. This shouldn't be happening, that's why I said....weird...


All times are GMT -4. The time now is 16:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.