Little Help
#1

Hello everybody, today I first time using hook from ******. But I have problem, I am hooking OnGameModeInit and when I start GM server is totally bugged, without that script in which I am using hook, server is working fine. Why when I am hooking OnGameModeInit server is bugged? I don`t understand. Can anyone explain me why is hook that doing?

CODE : http://pastebin.com/VFPeWLi5
Reply
#2

server buged ? the gang zone mix color ?
you have failed on the min x , y max x , y
Reply
#3

You only have 1 gangzone, but you are trying to loop through 50 of them... causing a out of bounds error and crashing your server.

You should use 'sizeof' instead.

pawn Код:
#include <YSI\y_hooks>
//==============================================================================
//--->>> Gang Zones
//==============================================================================
enum ZoneInfo
{
    Float:minX,
    Float:minY,
    Float:maxX,
    Float:maxY
}

new GangZone[][ZoneInfo] =
{
    {96.8898,1798.6938,390.6672,2081.8325}
};


hook OnGameModeInit()
{
    CreateGangZones();
    return 1;
}

stock CreateGangZones()
{
    for(new i = 0; i < sizeof(GangZone); i++)
    {
        GangZoneCreate(GangZone[i][minX], GangZone[i][minY], GangZone[i][maxX], GangZone[i][maxY]);
    }
    return 1;
}
Reply
#4

Can you show the main script's OnGameModeInit ?

And also, try including y_hooks there too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)