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(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(GetPlayerWantedLevel(issuerid) == 0 )
{
new health, armour;
GetPlayerHealth(issuerid, health);
SetPlayerHealth(issuerid, health);
GetPlayerArmour(issuerid, armour);
SetPlayerArmour(issuerid, armour);
}
return 1;
}
Re: Need Help On Script -
CaptainBoi - 06.09.2018
Quote:
Originally Posted by Orbit21
Try this :
PHP код:
OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(GetPlayerWantedLevel(issuerid) == 0 )
{
new health, armour;
GetPlayerHealth(issuerid, health);
SetPlayerHealth(issuerid, health);
GetPlayerArmour(issuerid, armour);
SetPlayerArmour(issuerid, armour);
}
return 1;
}
|
Your code wont work till you make those variables float lol
PHP код:
OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(GetPlayerWantedLevel(issuerid) == 0 )
{
static Float:health, Float:armour;
GetPlayerHealth(issuerid, health);
GetPlayerArmour(issuerid, armour);
SetPlayerHealth(issuerid, health);
SetPlayerArmour(issuerid, armour);
}
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(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(GetPlayerWantedLevel(issuerid) == 0 )
{
static Float:health, Float:armour;
GetPlayerHealth(issuerid, health);
GetPlayerArmour(issuerid, armour);
SetPlayerHealth(issuerid, health);
SetPlayerArmour(issuerid, armour);
}
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