Posts: 149
Threads: 22
Joined: Jun 2012
hello
I have added FS wich give for sniper 100dmg, so one hit, and human is death.
Question how i can add that dmg for Noose snipers and hitman snipers only?
so people cant abuse that in rp`?
Posts: 2,187
Threads: 81
Joined: Aug 2011
Reputation:
0
You can create a variable, make the damage 100 only if variable is 1, set variable 1 if player chooses class as hitman and for others, set it to 0.
Posts: 149
Threads: 22
Joined: Jun 2012
OKAY, i will show come , soon, if i get my battery full another laptop
Posts: 149
Threads: 22
Joined: Jun 2012
Quote:
Originally Posted by Rajat_Pawar
Add this to the top of your script.
pawn Код:
new isdmgsniper[MAX_PLAYERS]=0;
Then:
pawn Код:
public OnPlayerSpawn(playerid) { new skinid = GetPlayerSkin(playerid); if(skinid==17) { isdmgsniper[playerid]=1; } else isdmgsniper[playerid]=0; return 1; }
Add this above the line (if issuerid....)
pawn Код:
if (isdmgsniper[playerid]==1)
So now, if player chooses skin:
![](https://sampwiki.blast.hk/wroot/images2/a/a3/Skin_17.png)
his one sniper hit will result in a 100 pcnt health loss, or for other skins, it wont.
|
how to make fs with that? just do like you said in my fs?
Posts: 2,187
Threads: 81
Joined: Aug 2011
Reputation:
0
You dont need to 'make fs' with that, just add my code into your code (your FS).
Posts: 149
Threads: 22
Joined: Jun 2012
Quote:
Originally Posted by Shockey HD
Show us some code in order to help you.
Though it will look something like this
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34)
{
if(Noose Faction Varaible || Hitman Faction Variable)
{
SetPlayerHealth(playerid, 0.0);
}
}
return 1;
}
|
i got this error
Quote:
wdmg.pwn(40) : error 029: invalid expression, assumed zero
|
Posts: 149
Threads: 22
Joined: Jun 2012
Quote:
Originally Posted by Rajat_Pawar
Add this to the top of your script.
pawn Код:
new isdmgsniper[MAX_PLAYERS]=0;
Then:
pawn Код:
public OnPlayerSpawn(playerid) { new skinid = GetPlayerSkin(playerid); if(skinid==17) { isdmgsniper[playerid]=1; } else isdmgsniper[playerid]=0; return 1; }
Add this above the line (if issuerid....)
pawn Код:
if (isdmgsniper[playerid]==1)
So now, if player chooses skin:
![](https://sampwiki.blast.hk/wroot/images2/a/a3/Skin_17.png)
his one sniper hit will result in a 100 pcnt health loss, or for other skins, it wont.
|
I cant understand about this one, how to add it to fs