Wep dmg
#1

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`?
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

OKAY, i will show come , soon, if i get my battery full another laptop
Reply
#5

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:

his one sniper hit will result in a 100 pcnt health loss, or for other skins, it wont.
Reply
#6

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:

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?
Reply
#7

You dont need to 'make fs' with that, just add my code into your code (your FS).
Reply
#8

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

Reply
#9

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:

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)