Shoot someone with Deagle/Spas/Sniper will be Tazed -
DouglasRamirez - 06.10.2013
Hello, I'm looking for a system like the title says, Is there any command on how to do it?
Shoot someone with Deagle/Spas/Sniper will be Tazed
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
SilentSoul - 06.10.2013
Sorry i can't well understand you , you mean give him weapon ? deagle and etc ?
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
DouglasRamirez - 06.10.2013
No, I mean if you have SPAS/DEAGLE/Sniper and you shoot him/her he/she will get stunned/tazed (will fall down or something).
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
SilentSoul - 06.10.2013
ok sorry for wrong understand.
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34)
{
// This for sniper rifle when someone use it and shoot the shooted player will die from first shoot
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
Add this in any where in your script
https://sampwiki.blast.hk/wiki/Weapons
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
CesarLT - 06.10.2013
Use OnPlayerGiveDemage and OnPlayerTakeDemage to create that.
SetTimerEx, for the "freeze" to pass, and SetPlayerControllable to freeze the player.
Edit: For the fall down part use animations on OnPlayerTakeDemage..
Good luck.
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
DouglasRamirez - 06.10.2013
Quote:
Originally Posted by CesarLT
Use OnPlayerGiveDemage and OnPlayerTakeDemage to create that.
SetTimerEx, for the "freeze" to pass, and SetPlayerControllable to freeze the player.
Edit: For the fall down part use animations on OnPlayerTakeDemage..
Good luck. 
|
Where should I put this? I mean what Line.
Quote:
Originally Posted by SilentSoul
ok sorry for wrong understand.
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(issuerid != INVALID_PLAYER_ID && weaponid == 34) { // This for sniper rifle when someone use it and shoot the shooted player will die from first shoot SetPlayerHealth(playerid, 0.0); } return 1; }
Add this in any where in your script
https://sampwiki.blast.hk/wiki/Weapons
|
Same question to you
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
SilentSoul - 06.10.2013
Quote:
Originally Posted by DouglasRamirez
Where should I put this? I mean what Line.
Same question to you 
|
Add this any where you want in your script dont worry it wont effect any problems.
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
DouglasRamirez - 06.10.2013
Quote:
Originally Posted by SilentSoul
Add this any where you want in your script dont worry it wont effect any problems.
|
Alright, SPAS/Deagle is here too? Or just sniper?
btw, What anim should I put?
After putting it on the Bottom. I got this errors.
pawn Код:
C:\Users\user\Desktop\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(58040) : error 021: symbol already defined: "cmd_d"
C:\Users\user\Desktop\[0.3x]Razer Roleplay\gamemodes\RZRP.pwn(95257) : error 021: symbol already defined: "OnPlayerTakeDamage"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
SilentSoul - 06.10.2013
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34) //sniper
{
SetPlayerHealth(playerid, 0.0);
//add here anim you want
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24) // deagle
{
SetPlayerHealth(playerid, 0.0);
//add here anim you want
}
return 1;
}
how to add anims ?
https://sampwiki.blast.hk/wiki/ApplyAnimation
anims :
https://sampwiki.blast.hk/wiki/Animations
if you want to add more weapons just copy
pawn Код:
if(issuerid != INVALID_PLAYER_ID && weaponid == 34) //and change weaponid == 34 to the weapon you want
{
SetPlayerHealth(playerid, 0.0);
//add here anim you want
}
weapons list :
https://sampwiki.blast.hk/wiki/Weapons
Re: Shoot someone with Deagle/Spas/Sniper will be Tazed -
DouglasRamirez - 06.10.2013
Quote:
Originally Posted by SilentSoul
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(issuerid != INVALID_PLAYER_ID && weaponid == 34) //sniper { SetPlayerHealth(playerid, 0.0); //add here anim you want } if(issuerid != INVALID_PLAYER_ID && weaponid == 24) // deagle { SetPlayerHealth(playerid, 0.0); //add here anim you want } return 1; }
how to add anims ? https://sampwiki.blast.hk/wiki/ApplyAnimation
anims : https://sampwiki.blast.hk/wiki/Animations
if you want to add more weapons just copy
pawn Код:
if(issuerid != INVALID_PLAYER_ID && weaponid == 34) //and change weaponid == 34 to the weapon you want { SetPlayerHealth(playerid, 0.0); //add here anim you want }
weapons list : https://sampwiki.blast.hk/wiki/Weapons
|
Ok, But how can I fix that 2 errors? (Check my reply before yours)
also how many seconds he will be freeze?