Objects - 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: Objects (
/showthread.php?tid=627334)
Objects -
SpaceRP - 26.01.2017
I have a question?
Does anyone know how best to get rid of objects from GameMode, whether to include them as a switch or as FilterScript or something else? Thank you
Re: Objects -
Eoussama - 26.01.2017
Put them on a separate file, and include them, that's how I do it
Re: Objects -
Yaa - 26.01.2017
create a new file called
objects.pwn and put it in includes folder
PHP код:
forward OnMapsInit();
public OnMapsInit()
{
/* Objects here */
}
go to top of you script and add
PHP код:
#include <objects.pwn>
and add in OnGameModeInit
PHP код:
public OnGameModeInit()
{
OnMapsInit();
}
Re: Objects -
SpaceRP - 26.01.2017
Thanks
Re: Objects -
Sew_Sumi - 27.01.2017
Obviously he hasn't read the question right as to remove objects for players, they need to be removed under OnPlayerConnect... Adding objects to the streamer would be under OnGamemodeInit.
Re: Objects -
Sjn - 27.01.2017
I would recommend to make a separate filterscript. Can be loaded/unloaded via the rcon command. Easier to make changes to the objects as well.
Re: Objects -
Sew_Sumi - 27.01.2017
Quote:
Originally Posted by Sjn
I would recommend to make a separate filterscript. Can be loaded/unloaded via the rcon command. Easier to make changes to the objects as well.
|
There's a bug with filterscript reloading, it's better to have it in the gamemode especially if you want the gamemode to actually do things with the objects.
Re: Objects -
Sjn - 27.01.2017
Quote:
Originally Posted by Sew_Sumi
There's a bug with filterscript reloading, it's better to have it in the gamemode especially if you want the gamemode to actually do things with the objects.
|
Well, not for me at least. I've been using a filterscript for my maps since I started getting into pawn script and never faced any problems with objects adding/removing from the FS. This is just my recommendation from what I do though.
PS: If you are talking about the bug caused by the gmx, I read somewhere that the gmx is not recommended to restart the server.
Re: Objects -
Sew_Sumi - 27.01.2017
Na, pretty sure I member it being to do with reloading filterscripts specifically.
Easier just to have it all combined properly.