SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/01/2017, 08:30 PM   #1
SpaceRP
Big Clucker
 
Join Date: May 2013
Posts: 62
Reputation: 0
Question Objects

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
__________________
SpaceRP is offline   Reply With Quote
Old 26/01/2017, 09:28 PM   #2
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,071
Reputation: 281
Default Re: Objects

Put them on a separate file, and include them, that's how I do it
__________________

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning
Eoussama is offline   Reply With Quote
Old 26/01/2017, 09:58 PM   #3
Yaa
Banned
 
Join Date: May 2016
Location: = GetPlayerHouse("Yaa", 0.2);
Posts: 598
Reputation: 42
Default Re: Objects

create a new file called

objects.pwn and put it in includes folder

PHP Code:
forward OnMapsInit();
public 
OnMapsInit()
{
     
/* Objects here */

go to top of you script and add

PHP Code:
#include <objects.pwn> 
and add in OnGameModeInit

PHP Code:
public OnGameModeInit()
{
     
OnMapsInit();

Yaa is offline   Reply With Quote
Old 26/01/2017, 10:10 PM   #4
SpaceRP
Big Clucker
 
Join Date: May 2013
Posts: 62
Reputation: 0
Default Re: Objects

Thanks
__________________

Last edited by SpaceRP; 27/01/2017 at 12:07 AM.
SpaceRP is offline   Reply With Quote
Old 27/01/2017, 05:57 AM   #5
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,251
Reputation: 525
Default Re: Objects

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.
Sew_Sumi is offline   Reply With Quote
Old 27/01/2017, 06:48 AM   #6
Sjn
Huge Clucker
 
Join Date: Jul 2015
Location: Nepal
Posts: 349
Reputation: 50
Default Re: Objects

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.
Sjn is offline   Reply With Quote
Old 27/01/2017, 07:09 AM   #7
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,251
Reputation: 525
Default Re: Objects

Quote:
Originally Posted by Sjn View Post
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.
Sew_Sumi is offline   Reply With Quote
Old 27/01/2017, 07:20 AM   #8
Sjn
Huge Clucker
 
Join Date: Jul 2015
Location: Nepal
Posts: 349
Reputation: 50
Default Re: Objects

Quote:
Originally Posted by Sew_Sumi View Post
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.
Sjn is offline   Reply With Quote
Old 27/01/2017, 07:47 AM   #9
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,251
Reputation: 525
Default Re: Objects

Na, pretty sure I member it being to do with reloading filterscripts specifically.

Easier just to have it all combined properly.
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [alpha] Objects Physics - Handle objects collisions and more. PeppeAC Includes 237 07/06/2019 09:37 PM
[Tutorial] How to create custom destroyable objects or objects which can get damaged <0.3z> Lordzy Tutorials 33 03/10/2016 07:01 AM
[Map] Candidate Multipl0x Showroom (Textured objects | 0.3.7 Objects) SpikY_ Maps 23 30/08/2015 08:53 AM
Player Camera Goes Trough Objects And Attached Objects. [WSF]ThA_Devil Scripting Help 1 20/11/2013 03:40 PM
If I create the objects in virtual worlds that makes room for other objects? tal_peretz Help Archive 8 17/05/2011 02:48 PM


All times are GMT. The time now is 03:41 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.