y_hooks collision
#1

Includes and their order
pawn Код:
#include <a_samp>
    #undef MAX_PLAYERS
    #define MAX_PLAYERS     30      //Server Slots

#include <sscanf2>
#include <zcmd>
#include <YSI\y_iterate>
#include <YSI\y_va>
#include <YSI\y_hooks>
//#include <a_mysql>
#include <streamer>
#include <easyDialog>

//After few defines and variables
#include "TDM/TeamBalancer.pwn"
#include "TDM/TeamInfo.pwn"
Both files have same hook method like these, and return 1 at the end
pawn Код:
hook Test:OnPlayerRequestClass(playerid, classid)
{
    return 1;
}
Error:
pawn Код:
TDM/TeamChoser.pwn(40) : error 021: symbol already defined: "@yH_PlayerRequestClass1"
TDM/TeamChoser.pwn(41) : error 021: symbol already defined: "@yH_PlayerRequestClass1"
As error say its a function collision (same name). So what im doing wrong with hooks? (I know its me , i just cant find in documentation what it is)

EDIT: Problem solved.

I solved these by digging into y_hooks include topic. In case someone has same problem here is the problem.

We need to use:
pawn Код:
Hook:one_OnPlayerRequestClass(playerid, classid)
Please notice H is uppercase and that one_ is actually a prefix (you can name it whatever you want)

Or (I will quote ****** answer on same problem)
Quote:
Originally Posted by ******
Посмотреть сообщение
s0up: If you don't use the prefix version of the choose, you need to re-include y_hooks before every duplicate hook.
Reply
#2

sorry phone malfunctiond

i think that error is because u define that function twice in your script so delete 1
Reply
#3

Well i see that...and i also know its caused by y_hooks (actually me using it wrongly as nobody complained before). My only question is what im doing wrong?

EDIT: problem solved, if you have same problem fix is in first post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)