Scritp Vote Server

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
aslfama
Posts: 4
Joined: Wed Jan 12, 2011 4:21 am

Scritp Vote Server

Post 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
mochitto
Posts: 87
Joined: Fri Jul 18, 2008 2:27 pm
Location: Slovakia

Re: Scritp Vote Server

Post 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.
Sorry for my bad english.
aslfama
Posts: 4
Joined: Wed Jan 12, 2011 4:21 am

Re: Scritp Vote Server

Post 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
mochitto
Posts: 87
Joined: Fri Jul 18, 2008 2:27 pm
Location: Slovakia

Re: Scritp Vote Server

Post 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.
Sorry for my bad english.
kama3a
Posts: 125
Joined: Mon Jul 07, 2008 4:01 pm

Re: Scritp Vote Server

Post by kama3a »

the system have bugs with sessions and time of last vote.
dont use it for now :)
aslfama
Posts: 4
Joined: Wed Jan 12, 2011 4:21 am

Re: Scritp Vote Server

Post 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
aslfama
Posts: 4
Joined: Wed Jan 12, 2011 4:21 am

Re: Scritp Vote Server

Post by aslfama »

???????????????????????????????????
User avatar
sam.jr
Posts: 258
Joined: Wed Feb 02, 2011 6:23 am
Location: Russia

Re: Scritp Vote Server

Post by sam.jr »

I'll try to look what we can do with this..
== ==
User avatar
Bebop
Posts: 25
Joined: Mon Feb 21, 2011 11:27 pm

Re: Scritp Vote Server

Post by Bebop »

can anyone post the entire script?
User avatar
Moon
Posts: 192
Joined: Wed Feb 21, 2007 9:30 pm

Re: Scritp Vote Server

Post 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"
Post Reply