FS to GM
#1

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?
Reply
#2

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.
Reply
#3

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?
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

public OnFilterscriptInit() To public OnGameModeInit()
Reply
#8

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.
Reply
#9

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

i can convert it to OnGameModeinit For ya
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)