PDA

View Full Version : Need Help On Script


qlia
04/09/2018, 10:50 PM
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 !

qlia
05/09/2018, 12:59 PM
???? /: +up

v1k1nG
05/09/2018, 01:05 PM
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

qlia
06/09/2018, 07:11 AM
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

Orbit21
06/09/2018, 09:03 AM
Try this :

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;
}

CaptainBoi
06/09/2018, 12:10 PM
Try this :

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

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;
}

Orbit21
06/09/2018, 12:13 PM
Your code wont work till you make those variables float lol

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.

v1k1nG
06/09/2018, 12:48 PM
http://forum.sa-mp.com/showthread.php?t=606430