For destroyed variable get killed - 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: For destroyed variable get killed (
/showthread.php?tid=619409)
For destroyed variable get killed -
henkas - 17.10.2016
Sup
i have question how i should make a system like protection. I have variable called "Boxes" this variable create box and i want make if someone destroyed box (variable) he got killed for destroying it, bat its one important think if you destroyed you self you're not killed cuz its you're box like you own can destroy it bat someone next cant. And other think like variable called "TEAM_RED" can kill these box also with you.
Re: For destroyed variable get killed -
henkas - 17.10.2016
So have some ideas guys?
Re: For destroyed variable get killed -
Kaliber - 17.10.2016
Look at this callback:
https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
There you can check which objectid the player hit...
And now u have to check if the if(hitid == object[0]) and if object[0] for example is a object that he shouldnt destroyed you call SetPlayerHealth(playerid,0); and important use there DestroyObject(object[0]);
Good Luck
Re: For destroyed variable get killed -
henkas - 17.10.2016
Quote:
Originally Posted by Kaliber
Look at this callback: https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot
There you can check which objectid the player hit...
And now u have to check if the if(hitid == object[0]) and if object[0] for example is a object that he shouldnt destroyed you call SetPlayerHealth(playerid,0); and important use there DestroyObject(object[0]);
Good Luck 
|
Can you give me example?
Re: For destroyed variable get killed -
henkas - 18.10.2016
Can someone give me example cuz i'm not so smart at this.
Re: For destroyed variable get killed -
henkas - 18.10.2016
up up up up
Re: For destroyed variable get killed -
henkas - 18.10.2016
Someone?
Re: For destroyed variable get killed -
Micko123 - 18.10.2016
You said this
PHP код:
Can someone give me example cuz i'm not so smart at this.
Why don't you start from something simpler?? You should try making your GM from scratch. I suggest DM/FR gamemode because you can practise there and you have fully freedom there. It is not very hard. Start with login/register system (
https://sampforum.blast.hk/showthread.php?tid=273088 ). Then make Admin system then few Commands and expand your knowledge.
This is my suggestion.
Best whishes
Re: For destroyed variable get killed -
henkas - 18.10.2016
Quote:
Originally Posted by Micko123
You said this
PHP код:
Can someone give me example cuz i'm not so smart at this.
Why don't you start from something simpler?? You should try making your GM from scratch. I suggest DM/FR gamemode because you can practise there and you have fully freedom there. It is not very hard. Start with login/register system ( https://sampforum.blast.hk/showthread.php?tid=273088 ). Then make Admin system then few Commands and expand your knowledge.
This is my suggestion.
Best whishes 
|
I have done this simple steps like register/login and other stuffs cuz i can find a lot tutorial about it. Bat i need just this think and its be over.
Re: For destroyed variable get killed -
henkas - 18.10.2016
up up up up