SA-MP Forums Archive
[Ajuda] Interferкncia Include - GM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Interferкncia Include - GM (/showthread.php?tid=467559)



Interferкncia Include - GM - [THs]ShadoW - 03.10.2013

Fala galera, tranquilo ?

Estou desenvolvendo minha primeira Include, porйm, encontrei um problema, como fazer para as Callbacks usadas na Include nгo darem conflito com as do GM ?

Basta fazer um Hook, como este https://sampforum.blast.hk/showthread.php?tid=466010 ?

Ou necessita algo mais ?

Obrigado desde jб.

Abraзo.


Re: Interferкncia Include - GM - WLSF - 03.10.2013

Basta fazer o hook como aquele do tуpico, sim...



Porйm vocк tem que garantir de que vai utilizar a callback nos dois(include e GM) se nгo nгo faz sentido...

Abraзos.


Re: Interferкncia Include - GM - [THs]ShadoW - 03.10.2013

Aн que estб, irei divulgar a Include, entгo nгo tem como saber se serб ou nгo usada, vai depender do cуdigo de quem baixar..

Enfim, obrigado pela ajuda

+rep


Re: Interferкncia Include - GM - WLSF - 03.10.2013

Quote:
Originally Posted by [THs]ShadoW
Посмотреть сообщение
Aн que estб, irei divulgar a Include, entгo nгo tem como saber se serб ou nгo usada, vai depender do cуdigo de quem baixar..

Enfim, obrigado pela ajuda

+rep
Sendo assim precisa rever algumas coisas, nгo tenho certeza, mas acho que usando este tipo hook ele vai dar erro se tu nгo implementar a callback no GM...


Te fiz um exemplo de hook aqui que nгo darб erro caso o usuбrio nгo insira a callback que vocк fez o hook...

Exemplo Include usando OnGameModeInit
pawn Код:
forward whook_OnGameModeInit();

public OnGameModeInit()
{
    printf("Hooked callback");

    if (funcidx("whook_OnGameModeInit") != -1)
        return CallLocalFunction("whook_OnGameModeInit", "");

    return 1;
}

#if defined ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define OnGameModeInit whook_OnGameModeInit
#endif
Exemplo GM usando OnGameModeInit
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
   
    printf("Normal callback");
   
    return 1;
}



Re: Interferкncia Include - GM - [THs]ShadoW - 03.10.2013

Vou testar, obrigado