SA-MP Forums Archive
FS to GM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: FS to GM (/showthread.php?tid=599211)



FS to GM - Brys - 22.01.2016

I want to move a script from a filter script to a gamemode, the lines under
PHP код:
public OnFilterScriptInit()

Should go under>>?
PHP код:
public OnGameModeInit()

?
Because the pawn crashes and I have no Idea what errors I got, any help?


Re: FS to GM - AmigaBlizzard - 22.01.2016

Pawn doesn't know if your script is meant to be a gamemode or filterscript.
Renaming OnFilterScriptInit to OnGameModeInit won't crash the compiler.

There must be something else going on.


Re: FS to GM - Mikeydoo - 22.01.2016

Yes it should go under OnGameModeInit(). Correct me if i'm wrong, you want to take content from a filterscript and insert it in an already running gamemode right?


Re: FS to GM - [eLg]elite - 22.01.2016

There should be a line in your FS at the top saying #define Filterscript. Remove it and put anything that was under OnFilterScriptInit under OnGameModeInit.


Re: FS to GM - Brys - 23.01.2016

Quote:
Originally Posted by Mikeydoo
Посмотреть сообщение
Yes it should go under OnGameModeInit(). Correct me if i'm wrong, you want to take content from a filterscript and insert it in an already running gamemode right?
Yep, right.


Re: FS to GM - Brys - 23.01.2016

Quote:
Originally Posted by JacobTr
Посмотреть сообщение
There should be a line in your FS at the top saying #define Filterscript. Remove it and put anything that was under OnFilterScriptInit under OnGameModeInit.
Yeah.. I know, I only moved the required codes.


Re: FS to GM - Elegy - 23.01.2016

public OnFilterscriptInit() To public OnGameModeInit()


Re: FS to GM - Sew_Sumi - 23.01.2016

Obviously renaming it hasn't worked... Can people actually read the thread before posting up simpleton solutions?

I think the OP needs to start over on the script and get it done that way, rather than simply trying to "save time" by making a problem, and ending up waiting around for someone to fluke an answer.



Usually when Pawn freezes like that, there's a bigger issue. You may need to check for your braces, and look over your code a bit more, as it could be a simple typo that's causing this.


Re: FS to GM - Arshman - 23.01.2016

You can post the Code of
PHP код:
public OnFilterScriptInit() 

i can convert it to OnGameModeinit For ya


Re: FS to GM - Sawalha - 23.01.2016

if you have
pawn Код:
#define FILTERSCRIPT
remove it, remove onfilterscriptinit and onfilterscriptexit (copy what needed to be copied under them) and then write ongamemodeinit and ongamemodeexit callbacks and put what you've copied under each one (onfilterscriptinit content -> under ongamemodeinit)

put this code too:
pawn Код:
#else

main()
{
   
}

#endif
make sure that the number of brackets used in the whole script is even and not an odd, be cause you could've missed a bracket.