SetObjectMaterial after GMX on console
#1

Hi guys I'm currently using these objects

sfcenterzone[0] = CreateObject(11340, -2079.9531, 159.2031, 30.8672, 0.00, 0.00, 0.00, 400.0);
sfcenterzone[1] = CreateObject(10983, -2076.6484, 222.8516, 31.2188, 0.00, 0.00, 0.00, 400.0);
sfcenterzone[2] = CreateObject(11387, -2038.7500, 150.7109, 31.1953, 0.00, 0.00, 0.00, 400.0);
SetObjectMaterial(sfcenterzone[0], 0, 10972, "groundbit_sfse", "desgreengrass", 0);//grassdry_128HV
SetObjectMaterial(sfcenterzone[1], 1, 10972, "groundbit_sfse", "desgreengrass", 0);
SetObjectMaterial(sfcenterzone[2], 0, 3845, "boxhses_sfsx", "shingles1", 0);
SetObjectMaterial(sfcenterzone[2], 6, 11139, "firehouse_sfse", "ws_tunnelwall2", 0);
SetObjectMaterial(sfcenterzone[2], 11, 5848, "mainlcawn", "fakestone1_LA", 0);
SetObjectMaterial(sfcenterzone[2], 12, 3845, "boxhses_sfsx", "shingles1", 0);

Everything works okay in the server, then when I do "gmx" on console and I go back in game, those objects aren't there anymore, they just disappeared.
It only works again if I close the server and open it again. Anyone have any idea why this could be happening?
I'm also not using DestroyObject, also tried to do that but doesn't help with anything at all.
Reply
#2

Because OnPlayerDisconnect is called after GMX, so every objects, vehicles, pickups etc. disappear for everyone. Only PlayerPlaySound and audio streams still work, unless you add code to prevent it.
Reply
#3

Use either <fixes.inc> OR create a command that sets a timer for everything to occur before GMX.
Reply
#4

Oh I forgot to mention I'm using the code above in OnGameModeInit.
And the only objects that disappear are those with the materials, the rest of the objects that don't use materials are working correctly Libra_PL.
Rajat_Pawar, as far as I know there are no fixes for this in fixes.inc, At least shown in the topic.
Thank you for replying to my topic!
Please help guys.
Reply
#5

Bump..
Reply
#6

bump
Reply
#7

GMX causes client bugs galore it's really a waste of time just restart your sever and force clients to reconnect it's better that way.
Reply
#8

And for people who use round based games?

Its an issue that needs to be addressed internally. People should not have to spend tons of time finding work arounds for things that can be fixed rather easily via sa-mp source.
Reply
#9

Quote:
Originally Posted by cyber_punk
Посмотреть сообщение
And for people who use round based games?

Its an issue that needs to be addressed internally. People should not have to spend tons of time finding work arounds for things that can be fixed rather easily via sa-mp source.
Create dynamic round changing
Reply
#10

I guess there's no fix for this. Oh well guys, thank you for the replies at least now I know I can't do anything about it, gotta love these bugs, I mean... features. Lol.

EDIT: It's also funny that it works perfectly with CreatePlayerObject and SetPlayerObjectMaterial. Oh well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)