SA-MP Forums Archive
Players crash trying to login... - 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: Players crash trying to login... (/showthread.php?tid=611134)



Players crash trying to login... - iAssassin - 02.07.2016

I've added my island's map code like:

Код:
public OnPlayerConnect(playerid)
{
	//Island
	CreateObject(18359, 1006.79980, -3467.00000, -26.20000,   5.99900, 0.00000, 39.99600);
       (etc. etc. etc..... Over 1000 objects)
}
and it contains only "CreateObject".....

Now, whenever I or some of my friends try to login we/they immediately crash and it's caused by the objects (Tested it already)

Any ways to solve this ?


Re: Players crash trying to login... - J0sh... - 02.07.2016

1. CreateObject creates the object for everyone.
2. Over 1000 is the limit, use streamer.


Re: Players crash trying to login... - OmegaKiller72 - 02.07.2016

why onplayerconnect? use it at ongamemodinit!


Re: Players crash trying to login... - iAssassin - 03.07.2016

1) I know that CreateObject creates the object for everyone.
2) Will try
3) So if I add the objects under OnGameModeInit, crashes won't occur ?? Also is there an object limit for it ??


Re: Players crash trying to login... - Stinged - 03.07.2016

If there are over 1000 objects, you have to use a streamer.
Everyone would recommend this: https://sampforum.blast.hk/showthread.php?tid=102865

Also, just like OmegaKiller72 said, create them under OnGameModeInit.
If there are 10 objects, and 10 players go online, the amount of objects created would be 10*10.
That would be very bad for your server.


Re: Players crash trying to login... - Vince - 03.07.2016

Quote:
Originally Posted by iAssassin
Посмотреть сообщение
1) I know that CreateObject creates the object for everyone.
Yet you don't seem to understand that OnPlayerConnects gets fired every time a player connects. In other words, those 1k objects are created over and over and over again.


Re: Players crash trying to login... - iAssassin - 03.07.2016

hmm, ok I see, that's why.....
So the things I have to do are to include streamer and copy the CreateObject stuff under GameModeInit rather than OnPlayerConnect...

So to get your words straight you are saying that OnPlayerConnect it repeats/creates the object code everytime a player connects and OnGameModeInit creates the objects on gamemode/server connect/activation/init and it doesn't repeat.. so the crashes are caused from the CODE repeating... Right?


Re: Players crash trying to login... - Stinged - 03.07.2016

Yes, also, if you use the streamer, you have to use CreateDynamicObject.


Re: Players crash trying to login... - iAssassin - 03.07.2016

Ok... Well if under OnGameModeInit I have the animation and Team selection lines... Where should I add this, cause If I add it below the team selection...the team selection isn't going to appear... If I add this above that, I get an error...