SA-MP Forums Archive
RemoveBuildingForPlayer question. - 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: RemoveBuildingForPlayer question. (/showthread.php?tid=593714)



RemoveBuildingForPlayer question. - Adi007 - 08.11.2015

Hello. Currently i have a command which calls "OnPlayerConnect" and OnPlayerConnect(playerid) function removes some buildings for player.

Now, i need to make a command to make the objects appear again for the player, how can i do this? I already tried to call OnPlayerDisconnect and OnPlayerConnect using a command. I tried to call OnIncomingConnection too, but it didn't worked, the buildings were still removed for the player.

I tried to exit the game and i came again on the server with the same id. The buildings appeared, so there is a callback wich i don't know and it creates the default objects (i think).

We all know that OnPlayerConnect is the function where "RemoveBuildingForPlayer" is called, but i need to know which is the callback which creates the buildings for the connecting player.


Thanks and sorry for my low level english.


Re: RemoveBuildingForPlayer question. - Abagail - 08.11.2015

They don't get automatically added back again. When a player relogs the buildings are reloaded from the game, SA-MP simply removes them from the game's current memory / game session. You can however use CreateObject to recreate the objects.