Hooked callback won't get called
#1

Hey, since yesterday, i'm using y_hooks for easy callback hooking. Now i've got a problem:

Code:
Hook:DM_OnGameModeInIt()
{
	print("Called");
	for(new i=0; i<MAX_ZONES; i++){dmInfo[i][ZoneID]=-1;}
	for(new i=0; i<MAX_PLAYERS; i++){pDMinfo[i][0]=-1;}
	//The creating of the DM zones
	CreateDMZone("World War 2 DM","USA","Germany",-971.3320,1020.9902,1345.0673, -1135.7421,1095.4961,1345.8173, 10, 0, 24, 25, 30);
	return 1;
}
This won't get called. (based on the missing of the 'Called' print in my samp-server.exe) Can anybody tell me why's that?

Greetz,
Danny

EDIT: I'm also getting this message after some time: 'Error: Could not connect to the YSI update server.'
Maybe these two things has something to do with eachother?
Reply
#2

pawn Code:
Hook:DM_OnScriptInit( )
{
    print("Called");
    for(new i=0; i<MAX_ZONES; i++){dmInfo[i][ZoneID]=-1;}
    for(new i=0; i<MAX_PLAYERS; i++){pDMinfo[i][0]=-1;}
    //The creating of the DM zones
    CreateDMZone("World War 2 DM","USA","Germany",-971.3320,1020.9902,1345.0673, -1135.7421,1095.4961,1345.8173, 10, 0, 24, 25, 30);
    return 1;
}
Try it..
Reply
#3

I tried, buy it still doesn't work.
Reply
#4

Are you sure that you have the last Version of the YSI Library ?
Reply
#5

Now I've installed YSI 3.0 RC2, but the problem stays.
Reply
#6

Is an Include or a Gamemode / Filterscript ?
Reply
#7

Quote:
Originally Posted by aRoach
View Post
Is an Include or a Gamemode / Filterscript ?
It's in an include, i included it in my gamemode.
Reply
#8

you have included it after samp ?
anyways delete the yhook include and use this:
pawn Code:
stock My_OnGameModeInit()
{
// My Functions
print(" i was called ");
return CallRemoteFunction("OnGameModeInit","");

#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#endif

#define My_OnGameModeInit OnGameModeInit
writen with phone so there can be errors
post it and i can help

// works ?
Reply
#9

Maybe... :
pawn Code:
public DM_OnGameModeInit( )
{
    print("Called");
    for( new slots = MAX_ZONES, i; i < slots; i++ ) dmInfo[ i ][ ZoneID ]=-1;
    for( new slots = GetMaxPlayers( ), i; i < slots; i++ ) pDMinfo[ i ][ 0 ]=-1;
    //The creating of the DM zones
    CreateDMZone("World War 2 DM","USA","Germany",-971.3320,1020.9902,1345.0673, -1135.7421,1095.4961,1345.8173, 10, 0, 24, 25, 30);
    return 1;
}
#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif
#define OnGameModeInit DM_OnGameModeInit
forward DM_OnGameModeInit( );
Reply
#10

yep ! i wasnt sure but Roach code works 100% i use the same way, but i use stocks instead of public
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)