Players crash trying to login...
#1

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

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

why onplayerconnect? use it at ongamemodinit!
Reply
#4

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)