Page 1 of 1

Scritp Vote Server

Posted: Wed Jan 12, 2011 4:27 am
by aslfama
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4446:
L2JDP Revision 7703:

Hello ves a more personal, I'm with a mistake here and you can not resolve at all.
I have a script to vote for Gracia and will not work in Freya L2jServer tried everything nothing worked always the same error.

ERRO: Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/phoenix/public_html/vote/inc/functions.php on line 155

Location of the error:

Code: Select all

function receberItem($login,$dono,$pontos,$necessarios,$quantia,$recompensa) {    if($pontos >= $necessarios) {        $confere    =   mysql_query("SELECT * FROM items WHERE owner_id = '$dono' AND item_id = '$recompensa'");        $resultado  =   mysql_num_rows($confere);                 // $deletatodos = mysql_query("DELETE FROM items WHERE (owner_id = '$dono') AND (item_id = '$recompensa')");        $query  =   mysql_query("INSERT INTO items (owner_id, object_id, item_id, count, loc, loc_data, price_sell, price_buy) VALUES ('$dono', '".newObId()."', '$recompensa', '$quantia', 'WAREHOUSE', '0', '0', '0')");        #Gracia        //$query  =   mysql_query("INSERT INTO items (owner_id, object_id, item_id, count, enchant_level, loc, loc_data, time_of_use, custom_type1, custom_type2, mana_left, time) VALUES ('$dono', '".newObId()."', '$recompensa', '$quantia', '0', 'WAREHOUSE', '0', null, '0', '0', '-1', '-1')");        $reduz  =   mysql_query("UPDATE accounts SET pontos_trocar=(pontos_trocar-$necessarios) WHERE login = '$login'");        $nome = mysql_query("SELECT char_name FROM characters WHERE obj_Id = '$dono'");        $rnome = mysql_result($nome,0);
I hope someone knows ^ ^ thanks anyone who can help ... I am a few days with this and still nothing.

If posted in the wrong place sorry my first post here in the forum

Re: Scritp Vote Server

Posted: Thu Jan 13, 2011 2:47 pm
by mochitto

Code: Select all

        function receberItem($login, $dono, $pontos, $necessarios, $quantia, $recompensa)         {            if($pontos >= $necessarios)             {                // Check if player have items                $confere = mysql_query("SELECT `count`, `object_id` FROM `items` WHERE `owner_id` = '$dono' AND `item_id` = '$recompensa' AND `loc` = 'WAREHOUSE' LIMIT 1;");                $row = mysql_fetch_row($confere);                 if ($row[0] > 0)                                                $query = mysql_query("UPDATE `items` SET `count`='". ($row[0] + $quantia) ."' WHERE (`object_id`='".$row[1]."');");                else                    $query = mysql_query("INSERT INTO items (owner_id, object_id, item_id, count, enchant_level, loc, loc_data) VALUES ('$dono', '".newObId()."', '$recompensa', '$quantia', '0', 'WAREHOUSE', '0')");                $reduz = mysql_query("UPDATE accounts SET pontos_trocar=(pontos_trocar-$necessarios) WHERE login = '$login'");                $nome  = mysql_query("SELECT char_name FROM characters WHERE charId = '$dono'");                $rnome = mysql_result($nome, 0);                                echo mysql_error();            }        }
I think better will be make a core support or add to premium items table.
About

Code: Select all

 $reduz = mysql_query("UPDATE accounts SET pontos_trocar=(pontos_trocar-$necessarios) WHERE login = '$login'");
If you dont have login and game database same this cant work.
I tested it at last Freya rev.

Re: Scritp Vote Server

Posted: Fri Jan 14, 2011 12:20 pm
by aslfama
Thanks for helping me, I'm glad I can not do more help communicate with the database of Freya, I have attached the original file for you to take a look if you can modify it for me to be grateful.

http://www.4shared.com/file/vKGJs6UD/functions.html

Re: Scritp Vote Server

Posted: Fri Jan 14, 2011 1:03 pm
by mochitto
obj_Id change to charId, this want debug try use mysql_error() and find bugs.
Do you have created custom table/collums? Its hard to help you if you send me one file and say it dont work repair plx.

Re: Scritp Vote Server

Posted: Fri Jan 14, 2011 1:17 pm
by kama3a
the system have bugs with sessions and time of last vote.
dont use it for now :)

Re: Scritp Vote Server

Posted: Sat Jan 15, 2011 5:30 pm
by aslfama
system works perfect with Gracia Final, most still did not work with Freya still unable to communicate with the scripts database freya there goes the link for the complete system

http://www.4shared.com/file/mefUTBq0/vote.html

Re: Scritp Vote Server

Posted: Mon Jan 24, 2011 8:41 pm
by aslfama
???????????????????????????????????

Re: Scritp Vote Server

Posted: Thu Feb 03, 2011 7:03 pm
by sam.jr
I'll try to look what we can do with this..

Re: Scritp Vote Server

Posted: Tue Feb 22, 2011 12:17 am
by Bebop
can anyone post the entire script?

Re: Scritp Vote Server

Posted: Sat Apr 02, 2011 8:11 pm
by Moon
aslfama wrote:system works perfect with Gracia Final, most still did not work with Freya still unable to communicate with the scripts database freya there goes the link for the complete system

http://www.4shared.com/file/mefUTBq0/vote.html
Testing Gracia Final and Freya:

vote every 30 minutes - should be every 12 hours.
Date and time is of the cosmos.


and more errors with items:
"Ocorreu um erro"
"Erro ao atualizar os itens do personagem"