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


Messages In This Thread
y_hooks collision (Solved) - by DRIFT_HUNTER - 22.02.2015, 22:20
Re: y_hooks collision - by 1fret - 22.02.2015, 22:28
Re: y_hooks collision - by DRIFT_HUNTER - 22.02.2015, 22:31

Forum Jump:


Users browsing this thread: 2 Guest(s)