SA-MP Forums Archive
Need Help On Script - 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: Need Help On Script (/showthread.php?tid=658475)



Need Help On Script - qlia - 04.09.2018

hi guys . i cant find some thing like what i want , so i posted this topic .
i want a script that dont allow none wanted levels cant dmg the other none wanted level player no text just dont decrease the players health

and the other one , if a player with wanted level killed some other guy who doesent have wanted lvl this chat appear in chat for him : You Should Not Kill None Wanted Players !
**** but if the the player with 0 wanted level gave dmg to that player who has wanted level its ok and should not show anything in chat

srry for my bad english . if you can help me please !


Re: Need Help On Script - qlia - 05.09.2018

? /: +up


Re: Need Help On Script - v1k1nG - 05.09.2018

1) Play with GetPlayerWantedLevel, SetPlayerWantedLevel, OnPlayerWeaponShot and SetPlayerTeam.
Random idea I have now, is setting every player with the "no wanted level" in the same team, so they can't damage theirselves.

2)Use SetPlayerWantedLeven and GetPlayerWantedLevel


Re: Need Help On Script - qlia - 06.09.2018

i do this : if player was on this teams : team1 team2 team3 cant give dmg to no wanted players , but how should i set his gun dmg on 0 when he shot to no wanted players ? just havr problem this part


Re: Need Help On Script - Orbit21 - 06.09.2018

Try this :
PHP код:
OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
 if(
GetPlayerWantedLevel(issuerid) == )
 {
   new 
healtharmour;
   
GetPlayerHealth(issueridhealth);
   
SetPlayerHealth(issueridhealth);
   
GetPlayerArmour(issueridarmour);
   
SetPlayerArmour(issueridarmour);
 }
 return 
1;




Re: Need Help On Script - CaptainBoi - 06.09.2018

Quote:
Originally Posted by Orbit21
Посмотреть сообщение
Try this :
PHP код:
OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
 if(
GetPlayerWantedLevel(issuerid) == )
 {
   new 
healtharmour;
   
GetPlayerHealth(issueridhealth);
   
SetPlayerHealth(issueridhealth);
   
GetPlayerArmour(issueridarmour);
   
SetPlayerArmour(issueridarmour);
 }
 return 
1;

Your code wont work till you make those variables float lol
PHP код:
OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
 if(
GetPlayerWantedLevel(issuerid) == )
 {
   static 
Float:healthFloat:armour;
   
GetPlayerHealth(issueridhealth);
   
GetPlayerArmour(issueridarmour);
   
SetPlayerHealth(issueridhealth);
   
SetPlayerArmour(issueridarmour);
 }
 return 
1;




Re: Need Help On Script - Orbit21 - 06.09.2018

Quote:
Originally Posted by CaptainBoi
Посмотреть сообщение
Your code wont work till you make those variables float lol
PHP код:
OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
 if(
GetPlayerWantedLevel(issuerid) == )
 {
   static 
Float:healthFloat:armour;
   
GetPlayerHealth(issueridhealth);
   
GetPlayerArmour(issueridarmour);
   
SetPlayerHealth(issueridhealth);
   
SetPlayerArmour(issueridarmour);
 }
 return 
1;

Thanks for the correction, appreciate it.


Re: Need Help On Script - v1k1nG - 06.09.2018

https://sampforum.blast.hk/showthread.php?tid=606430