Shoot someone with Deagle/Spas/Sniper will be Tazed
#1

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

Sorry i can't well understand you , you mean give him weapon ? deagle and etc ?
Reply
#3

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

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

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)