SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 22/04/2017, 07:09 PM   #681
crukk11
Huge Clucker
 
crukk11's Avatar
 
Join Date: Jan 2017
Location: Malaysia
Posts: 313
Reputation: 5
Default Re: weapon-config.inc - Damage system with many features

like this

PHP Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 9)
    {
     if(
IsPlayerConnected(issuerid))
     {
       if(
bodypart == && !IsPlayerAdmin(playerid) && !god_mode[playerid])
          {
             
SetPlayerHealth(playerid0.0);
             new 
string[100], pname[24];
             
GetPlayerName(playeridheadshotsizeof(headshot));
             
GetPlayerName(issueridpnamesizeof(pname));
             
format(stringsizeof(string), "%s(%i) was shoot to the Head by %s(%i)"headshot,playeridpnameissuerid);
             
GivePlayerMoney(issuerid1000);
             
SendClientMessageToAll(0x800000AA,string);
             
GameTextForPlayer(issuerid,"~r~HeadShot",2000,1);
             
PlayerPlaySound(issuerid178020.00.00.0);
             
GameTextForPlayer(playerid,"~r~HeadShot",2000,1);
             
ClearAnimations(playerid);
             
ApplyAnimation(playerid"PED""ko2"4.1111111); // applying the dead guy animation tho you can one your own.
             
PlayerPlaySound(playerid178020.00.00.0);
          {
             if(
god_mode[playerid])
             return 
0;
          }
     }
    }
  return 
1;


Last edited by crukk11; 22/04/2017 at 09:33 PM.
crukk11 is offline   Reply With Quote
Old 22/04/2017, 08:58 PM   #682
renatog
Huge Clucker
 
Join Date: Mar 2016
Posts: 327
Reputation: 48
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by AbyssMorgan View Post
Latest update: 11 Sep 2016
Someone update this include ?
The include is almost stable (mine is heavily modified, so I don't know about the original file) and SKY is up together! But would be nice someone investigating the issues, seems that Slice doesn't have time to do that.
renatog is offline   Reply With Quote
Old 23/04/2017, 04:50 AM   #683
crukk11
Huge Clucker
 
crukk11's Avatar
 
Join Date: Jan 2017
Location: Malaysia
Posts: 313
Reputation: 5
Default Re: weapon-config.inc - Damage system with many features

PHP Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart

    if(
issuerid != INVALID_PLAYER_ID && bodypart == 9
    { 
     if(
IsPlayerConnected(issuerid)) 
     { 
       if(
bodypart == && !IsPlayerAdmin(playerid) && !god_mode[playerid]) 
          { 
             
SetPlayerHealth(playerid0.0); 
             new 
string[100], pname[24]; 
             
GetPlayerName(playeridheadshotsizeof(headshot)); 
             
GetPlayerName(issueridpnamesizeof(pname)); 
             
format(stringsizeof(string), "%s(%i) was shoot to the Head by %s(%i)"headshot,playeridpnameissuerid); 
             
GivePlayerMoney(issuerid1000); 
             
SendClientMessageToAll(0x800000AA,string); 
             
GameTextForPlayer(issuerid,"~r~HeadShot",2000,1); 
             
PlayerPlaySound(issuerid178020.00.00.0); 
             
GameTextForPlayer(playerid,"~r~HeadShot",2000,1); 
             
ClearAnimations(playerid); 
             
ApplyAnimation(playerid"PED""ko2"4.1111111); // applying the dead guy animation tho you can one your own. 
             
PlayerPlaySound(playerid178020.00.00.0); 
          { 
             if(
god_mode[playerid]) 
             return 
0
          } 
     } 
    } 
  return 
1

like this ?
crukk11 is offline   Reply With Quote
Old 23/04/2017, 05:30 PM   #684
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by crukk11 View Post
PHP Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart

    if(
issuerid != INVALID_PLAYER_ID && bodypart == 9
    { 
     if(
IsPlayerConnected(issuerid)) 
     { 
       if(
bodypart == && !IsPlayerAdmin(playerid) && !god_mode[playerid]) 
          { 
             
SetPlayerHealth(playerid0.0); 
             new 
string[100], pname[24]; 
             
GetPlayerName(playeridheadshotsizeof(headshot)); 
             
GetPlayerName(issueridpnamesizeof(pname)); 
             
format(stringsizeof(string), "%s(%i) was shoot to the Head by %s(%i)"headshot,playeridpnameissuerid); 
             
GivePlayerMoney(issuerid1000); 
             
SendClientMessageToAll(0x800000AA,string); 
             
GameTextForPlayer(issuerid,"~r~HeadShot",2000,1); 
             
PlayerPlaySound(issuerid178020.00.00.0); 
             
GameTextForPlayer(playerid,"~r~HeadShot",2000,1); 
             
ClearAnimations(playerid); 
             
ApplyAnimation(playerid"PED""ko2"4.1111111); // applying the dead guy animation tho you can one your own. 
             
PlayerPlaySound(playerid178020.00.00.0); 
          { 
             if(
god_mode[playerid]) 
             return 
0
          } 
     } 
    } 
  return 
1

like this ?
Try this.
PHP Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
    if(
god_mode[playerid])
        return 
0
    
    if(
issuerid != INVALID_PLAYER_ID && bodypart == 9)// I recommend defining bodyparts.
    
{
        if(
IsPlayerConnected(issuerid))  
        {
            new 
string[100], pname[24];
            
GetPlayerName(playeridheadshotsizeof(headshot));
            
GetPlayerName(issueridpnamesizeof(pname));
            
format(stringsizeof(string), "%s(%i) was shot in the head by %s(%i)"headshot,playeridpnameissuerid);
            
SendClientMessageToAll(0x800000AA,string);
            
GameTextForPlayer(issuerid,"~r~HeadShot",2000,1);
            
//PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);// There is already a ding sound that you can play when someone gets shot.
            
GameTextForPlayer(playerid,"~r~HeadShot",2000,1);
            
//ClearAnimations(playerid);
            //ApplyAnimation(playerid, "PED", "ko2", 4.1, 1, 1, 1, 1, 1, 1);// Redundant? People already play a custom animation when getting shot in the head and falling down in weapon-config.
            //PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0);// There is already a ding sound that you can play when someone gets shot.
            
GivePlayerMoney(issuerid1000);
            
amount 0.0;// If you set the amount of damage to 0.0, it means that it kills the player. As is documented here: https://github.com/oscar-broman/samp-weapon-config#new-callbacks
            
return 1;//Returning 1 to make sure that the damage gets applied right away.
        
}
    }
    return 
1;

__________________
Jeroen52 is offline   Reply With Quote
Old 23/05/2017, 08:18 AM   #685
asri
Big Clucker
 
Join Date: May 2017
Location: Malaysia
Posts: 150
Reputation: 2
Default Re: weapon-config.inc - Damage system with many features

nice
asri is offline   Reply With Quote
Old 30/05/2017, 11:13 AM   #686
Cypress
Gangsta
 
Cypress's Avatar
 
Join Date: Dec 2009
Location: Germany
Posts: 937
Reputation: 127
Default Re: weapon-config.inc - Damage system with many features

forward WC_OnPlayerDeathFinished(playerid, bool:cancelable);

Using public OnPlayerDeathFinished( playerid ) is giving warnings. Yet in the documentation it's declared like this.

Code:
warning 202: number of arguments does not match definition
error 025: function heading differs from prototype
So the question is, what is bool:cancelable used for?
__________________

Welcome stranger. I like your attitude.
Cypress is offline   Reply With Quote
Old 12/06/2017, 09:38 PM   #687
aoky
Huge Clucker
 
aoky's Avatar
 
Join Date: Oct 2016
Location: Ireland
Posts: 493
Reputation: 136
Default Re: weapon-config.inc - Damage system with many features

weapon-config.inc(169 : warning 203: symbol is never used: "addsiren"

Why is this happening?
__________________
owner/developer @ koky's deathmatch
aoky is offline   Reply With Quote
Old 12/06/2017, 10:33 PM   #688
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by aoky View Post
weapon-config.inc(169 : warning 203: symbol is never used: "addsiren"

Why is this happening?
Can you paste your weapon-config.inc?
__________________
Jeroen52 is offline   Reply With Quote
Old 10/07/2017, 09:15 PM   #689
Freedom.
Big Clucker
 
Join Date: Oct 2012
Posts: 126
Reputation: 12
Default Re: weapon-config.inc - Damage system with many features

Can someone give example about drive-by? I searched but found nothing.
Freedom. is offline   Reply With Quote
Old 10/07/2017, 09:30 PM   #690
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Freedom. View Post
Can someone give example about drive-by? I searched but found nothing.
What do you want to accomplish?
__________________
Jeroen52 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with weapon damage system thanks JessThompson Scripting Help 7 15/07/2014 01:01 PM
[FilterScript] New Weapon Damage System [0.3z] RenSoprano Filterscripts 6 17/01/2014 06:03 AM
[FilterScript] Weapon damage system [v1.0] Darnell Filterscripts 74 21/10/2013 08:53 PM
[FilterScript] Weapon Damage System Donicans Filterscripts 14 06/11/2012 01:22 PM
[FilterScript] Realistic Weapon Damage And Death System [V1.0][New Cool FS] Nirzor Filterscripts 6 08/08/2012 05:34 AM


All times are GMT. The time now is 03:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.