SA-MP Forums Archive
Damage Protection(createplayerobject) - 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: Damage Protection(createplayerobject) (/showthread.php?tid=621723)



Damage Protection(createplayerobject) - Killa[DGZ] - 14.11.2016

Hey guys, let me explain, this is regarding my new mode.

When a base is destroyed the base goes into what is known as damage protection, this means the base can no longer be attacked until it's repaired, if the player attacks someone while under protection.. their protection is removed an they again become vulnerable to attacks.

How should I go about storing the playerobject for the other players?, keep in mind that I need to make the exception for 100 players that can be under protection at once.. thats 100 protection objects that can possibly be created for each single player, obviously the playerobject won't be created for the ones that have the protection(enabling them to leave base an so on).



In short, is there a way to do this without creating 100 player variables for each player?



Thanks for reading, I hope someone can help me with an alternative idea .


Re: Damage Protection(createplayerobject) - SoFahim - 14.11.2016

If you use SetPlayerAttachedObject it will never give you solid object.

You should use a scripted protection type god mod with range sync.


Re: Damage Protection(createplayerobject) - SickAttack - 14.11.2016

What, objects? Array?


Re: Damage Protection(createplayerobject) - Killa[DGZ] - 14.11.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
What, objects? Array?
Can you give a small example of an array which can store 100 objects for every player slot please?

You mean something like 'new PlayerBaseProtection[MAX_PLAYERS][99];'?


EDIT: That works great, thanks heaps sickattack!