katursis / Pawn.CMD

🚀 Plugin-powered command processor for SA:MP server
MIT License
119 stars 13 forks source link

Pawn.CMD.inc minor improvements #2

Closed AbyssMorgan closed 8 years ago

AbyssMorgan commented 8 years ago

Performing hook on OnFilterScriptInit and OnGameModeInit provided #if defined FILTERSCRIPT is not necessary. The server performs only one callback, depending on the type of script. Therefore both callbacks use is not a problem.

Second suggestion if you could add other detection systems commands :)

if defined CMD

#error Detected another command system

endif

katursis commented 8 years ago

Performing hook on OnFilterScriptInit and OnGameModeInit provided #if defined FILTERSCRIPT is not necessary. The server performs only one callback, depending on the type of script. Therefore both callbacks use is not a problem.

No. The server performs "OnGameModeInit" for every script.

Second suggestion if you could add other detection systems commands :)

Not all command processors use "CMD" macros.

AbyssMorgan commented 8 years ago

Run this script as a gamemode and then as filterscript :D

include

main(){ printf("main"); }

public OnFilterScriptInit(){ printf("script"); return 1; }

public OnGameModeInit(){ printf("gamemode"); return 1; }

katursis commented 8 years ago

gamemode: [19:59:44] gamemode [19:59:44] main filterscript: [20:00:59] script [20:00:59] gamemode