YSI_Hooks
#1

hey

Код:
C:\Users\Karolis\Desktop\StoryOfAll\gamemodes\mysqlGM.pwn(15) : error 021: symbol already defined: "@yH_OnGameModeInit@003"
C:\Users\Karolis\Desktop\StoryOfAll\gamemodes\mysqlGM.pwn(15) : error 021: symbol already defined: "@yH_OnGameModeInit@003"

#include "..\gamemodes\modules\server\DataBase.pwn"

hook OnGameModeInit(){ main pwn


date base pwn

hook OnGameModeInit() {

	mysql_debug( true );
	mysql_connect( MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS );
	if( mysql_ping( ) >= 1 )    print( "\n" );
	else   						print("OFF( "MySQL_DATA" )");

	AddPlayerClass(0, 0, 0,0,4,0,0,0,0,0,0);
}

hook OnGameModeExit() {
	mysql_close();
}
Reply
#2

wtf, you're thinking that this will make your gm faster? nooooooooooooooooooo
hook is used, when same native is used include file, but main pwn you use public.
public OnGameModeInit(){

}
and so on...
Reply
#3

Cause u already define it ._.
Reply
#4

ohh okey ) and one more...

Код:
i use

#include "..\gamemodes\modules\player\auth.pwn"
#include "..\gamemodes\modules\server\News.pwn"

auth.pwn code:

#include <YSI_Coding\y_hooks>

hook OnPlayerConnect(playerid) {
 	online[playerid] = false;
	trylog[playerid] = 0;
}

but i get.. error 017: undefined symbol "online"

News.pwn code

#include <YSI_Coding\y_hooks>

new
	
	bool: online[MAX_PLAYERS],    	
	bool: from_login[MAX_PLAYERS],
	bool: from_reg[MAX_PLAYERS],  
	
	trylog[MAX_PLAYERS];
Reply
#5

Well because you define your variables in "News.pwn" which is included after "auth.pwn"
Creating variables in a different file should be avoided because the variable names could change or they are removed in later versions of the file, you should create functions to access these
Reply
#6

Nero, maybe can example who create function to access ?
Reply
#7

You must include y_hooks in all files it is to be used in.
You can't define the same hook in the same file multiple times.

@CodeStyle175: It's not about speed dumb fuck. It's a hook method.
Reply
#8

one more..

why and how to fix it..

Код:
warning 203: symbol is never used: "cmdhelp"
warning 203: symbol is never used: "heal"

YCMD:heal(playerid, params[], help)
{
    if(help)
        SendClientMessage(playerid, -1, "Command will heal you");
    else 
        SetPlayerHealth(playerid, 100.0);
    return 1;
}
YCMD:cmdhelp(playerid, params[], help)
{
    if(help)
        SendClientMessage(playerid, -1, "command help");

    else if(isnull(params))
        SendClientMessage(playerid, -1, "use:/cmdhelp command name");

    else
        Command_ReProcess(playerid, params, true);

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)