Raised This Month: $ Target: $400
 0% 

Multiple function arguments


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
orglee
Member
Join Date: Dec 2005
Old 06-03-2009 , 17:34   Re: Multiple function arguments
Reply With Quote #7

Well to bad, but I was about to change that function to normal SQL_PrepareQuery() anyway after I'll finish debuging. - Or not if you can tell me how to check if plugin is in debuging mode ( "plugin.amxx debug" in plugins.ini ) or not.

I still have two problems that are not especially connected to this topic, but those are probably caused by my stupid mistakes so I think they don't deserve another topic.

So here it goes:
1. Weird number is being inserted/fetched to/from database.
Code:
new iPlayerID new Handle:InsertQuery_1, Handle:InsertQuery_2, Handle:InsertQuery_3 InsertQuery_1 = SQLQueryCreate("INSERT INTO `stats_player`(`sp_steamid`, `sp_lastseen`) VALUES('%s', NOW())", sAuthid) if(!SQL_Execute(InsertQuery_1)) { SQLQueryError(InsertQuery_1, "Unable to insert new player"); } InsertQuery_2 = SQLQueryCreate("SELECT `sp_id` FROM `stats_player` WHERE `sp_steamid` = '%s'", sAuthid) if(!SQL_Execute(InsertQuery_2)) { SQLQueryError(InsertQuery_2, "Unable to retrive inserted player id"); } SQL_ReadResult(InsertQuery_2, 0, iPlayerID) InsertQuery_3 = SQLQueryCreate("INSERT INTO `stats_player_names`(`spn_name`, `spn_timesused`, `_sp_id`) VALUES('%s', 1, %i)", sPlayerName, iPlayerID) if(!SQL_Execute(InsertQuery_3)) { SQLQueryError(InsertQuery_3, "Unable to insert player nickname"); }
It creates two fallowing queries:
Code:
SELECT `sp_id` FROM `stats_player` WHERE `sp_steamid` = 'STEAM_0:1:12257932'
INSERT INTO `stats_player_names`(`spn_name`, `spn_timesused`, `_sp_id`) VALUES('ajt', 1, 1096810496)
I tried to use SQL_GetInsertId () and event "SELECT LAST_INSERT_ID()" but it wasnt working at all, thats why I'm using "SELECT"

Where first query is ok, second one is far from it as third value ( _sp_id ) I should get 14. What is going on?

2. To write players map time I want to use forwarding methods.
Code:
new iReturn, iForward = CreateMultiForward("hndl_ClimbCounterStop",ET_IGNORE,FP_CELL) if(iForward < 0) { log_amx("[CLIMB][ERROR] Unable to create forward."); } if(!ExecuteForward(iForward,iReturn,id-1,timer[id-1][TMR_BSTTME])) {     log_amx("[CLIMB][ERROR] Unable to execute forward.") }   DestroyForward(iForward)
Code:
[AMXX] Run time error 10: native error (native "ExecuteForward")
edit>
Damn wrong button - still writing
edit>>
I think I'm done writing... sorry...

Last edited by orglee; 06-03-2009 at 17:45.
orglee is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:53.


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