-
RogerCosta - 09.09.2015
Jeroen52 and JustMe.77, i tried and error continues showing. I tried too remove others includes, and error continues
Line of error:
Quote:
#if defined _ALS_OnPlayerDamage
#undef OnPlayerDamage
#else
#define _ALS_OnPlayerDamage
#endif
#define OnPlayerDamage WC_OnPlayerDamage
#if defined WC_OnPlayerDamage
forward WC_OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
#endif
|
Fixed
In line: forward WC_OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
i change to: forward WC_OnPlayerDamage(playerid, Float:amount, issuerid, weapon, bodypart);
Compiled. Thanks for helping JustMe.77 and Jeroen52.
Public OnPlayerDeath is called? how do i know who is killerid (like OnPlayerDeath) in Weapon Config System?
*Sorry my bad english, please.
Example, in OnPlayerDamageDone:
Quote:
public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart)
{
new Float:Health;
GetPlayerHealth(playerid, Health);
if(Health < amount)
{
// Playerid death...
SendDeathMessage(issuerid, playerid, weapon);
// ...
}
return 1;
}
|
Right?
Re: weapon-config.inc - Damage system with many features -
Slice - 09.09.2015
issuerid is the killerid
Also why did you remove the ampersands (&) from WC_OnPlayerDamage? They are there so you can modify the values.
Re: weapon-config.inc - Damage system with many features -
RogerCosta - 10.09.2015
Slice, OnPlayerDamageDone is called when player "death" or only is called "OnPlayerDamage" return 1?
Yeah, if player deaths, of course onplayerdamage is return 1, but ex: playerid health = 50 and damage (amount) = 20 (return 1), in this case, onplayerdamagedone is called too?
--
Quote:
Also why did you remove the ampersands (&) from WC_OnPlayerDamage? They are there so you can modify the values.
|
I have no idea why removed ampersands. I downloaded include, and i put #include <weapon-config> and <SKY> on top of gamemode, except a_samp, and press de butom F5 for compile, showing error in the line 5426:
Quote:
weapon-config.inc(5426) : error 025: function heading differs from prototype
|
--
You have plugin SKY for 0.3.7 R2-1 compiled for Windows?
Thanks for helping
.
Re: weapon-config.inc - Damage system with many features -
Lunoxel - 11.09.2015
Thank you man ! I need this.
rep ++ ; :P
Re: weapon-config.inc - Damage system with many features -
blastdap - 14.09.2015
I dunno what is happening but when i use an "damage indicator" (who shows a gun above your head) script on OnPlayerDamage, all the self damage (like Rocket launcher, falls, fire) don't work, and when i use this script in OnPlayerDamageDone the self damage are all bugged (like fall gives -100 damage but i'm no dying, or Rocket Launcher doing 0 damage or fire inflict damage but i'm not dying etc...)
This is the code i'm using:
Code:
KillTimer(Player[issuerid][P_OBJ_TIMER]);
if(Player[issuerid][P_ARMAPLAYER] != 0) DestroyObject(Player[issuerid][P_ARMAPLAYER]);
Player[issuerid][P_ARMAPLAYER] = CreateObject(weaponObj[weapon], 0, 0, 0, 0, 0, 0);
AttachObjectToPlayer(Player[issuerid][P_ARMAPLAYER], issuerid, 0, 0, 1.35, 0, 0, 0);
Player[issuerid][P_OBJ_TIMER][0] = SetTimerEx("HideWeaponObject", 1000, false, "i", issuerid);
Player[issuerid][P_OBJ_TIMER][1] = 1;
Re: weapon-config.inc - Damage system with many features -
Slice - 14.09.2015
Do you check if issuerid is INVALID_PLAYER_ID? Otherwise you will get an array out of bounds error, which will cause the problems you describe.
Re: weapon-config.inc - Damage system with many features -
blastdap - 14.09.2015
Quote:
Originally Posted by Slice
Do you check if issuerid is INVALID_PLAYER_ID? Otherwise you will get an array out of bounds error, which will cause the problems you describe.
|
OMG, Ty Slice, it worked!! you're is best
you don't know how i'm happy bro!
Fixed code:
Quote:
if(issuerid == !INVALID_PLAYER_ID)
{
KillTimer(Player[issuerid][P_OBJ_TIMER]);
if(Player[issuerid][P_ARMAPLAYER] != 0) DestroyObject(Player[issuerid][P_ARMAPLAYER]);
Player[issuerid][P_ARMAPLAYER] = CreateObject(weaponObj[weapon], 0, 0, 0, 0, 0, 0);
AttachObjectToPlayer(Player[issuerid][P_ARMAPLAYER], issuerid, 0, 0, 1.35, 0, 0, 0);
Player[issuerid][P_OBJ_TIMER][0] = SetTimerEx("HideWeaponObject", 1000, false, "i", issuerid);
Player[issuerid][P_OBJ_TIMER][1] = 1;
}
|
(I'm learning pawn, that is why i'm have difficult in a "simple" thing ;-; )
rep ++
Re: weapon-config.inc - Damage system with many features -
RogerCosta - 14.09.2015
Slice, you have a link SKY plugin compiled for windows server 0.3.7 R2-1? I do not know compile plugins :/
Re: weapon-config.inc - Damage system with many features -
Fungi - 14.09.2015
Is there is any way to use DamagePlayer() inside OnPlayerDamage ?
Re: weapon-config.inc - Damage system with many features -
Crayder - 14.09.2015
Quote:
Originally Posted by Fungi
Is there is any way to use DamagePlayer() inside OnPlayerDamage ?
|
OnPlayerDamage is where you should finish processing and add finishing touches to the damage. If you return 1 the damage will be done anyways so why would you want to use DamagePlayer in that callback at all?
Re: weapon-config.inc - Damage system with many features -
Fungi - 14.09.2015
Quote:
Originally Posted by Crayder
OnPlayerDamage is where you should finish processing and add finishing touches to the damage. If you return 1 the damage will be done anyways so why would you want to use DamagePlayer in that callback at all?
|
Well, i would like to make a headshot system.. if body part == 9 and weapon == 34 The player dies instantly. But using damageplayer in onplayerdamage callback will lead to endless loop (because damageplayer calls onplayerdamage)
Re: weapon-config.inc - Damage system with many features -
Slice - 14.09.2015
Quote:
Originally Posted by blastdap
OMG, Ty Slice, it worked!! you're is best
you don't know how i'm happy bro!
Fixed code:
(I'm learning pawn, that is why i'm have difficult in a "simple" thing ;-; )
rep ++
|
You did one thing wrong though! Do it like this intead:
pawn Code:
if (issuerid != INVALID_PLAYER_ID)
Re: weapon-config.inc - Damage system with many features -
RogerCosta - 14.09.2015
Slice, i downloaded weapon-config and put include folder, in gamemode
Code:
#include <a_samp>
#include <weapon-config>
#include <SKY>
but shows error: weapon-config.inc(5426) : error 025: function heading differs from prototype
Re: weapon-config.inc - Damage system with many features -
Crayder - 14.09.2015
Quote:
Originally Posted by Fungi
Well, i would like to make a headshot system.. if body part == 9 and weapon == 34 The player dies instantly. But using damageplayer in onplayerdamage callback will lead to endless loop (because damageplayer calls onplayerdamage)
|
Exactly my point. You don't need to use DamagePlayer at all in that callback. Just do the following:
pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
if(bodypart == 9 && weapon == 34)
amount = 100.0;
return 1;
}
That will cause the player to die in OnPlayerDamageDone.
Re: weapon-config.inc - Damage system with many features -
Fungi - 14.09.2015
Quote:
Originally Posted by Crayder
Exactly my point. You don't need to use DamagePlayer at all in that callback. Just do the following:
pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) { if(bodypart == 9 && weapon == 34) amount = 100.0; return 1; }
That will cause the player to die in OnPlayerDamageDone.
|
Oh thanks. I didnt know it works that way
Re: weapon-config.inc - Damage system with many features -
Slice - 15.09.2015
If you want someone to die (even if they have armour or 99999 health), just set amount to 0.0.
@RogerCosta: Update your samp inlcludes and show me your code
Re: weapon-config.inc - Damage system with many features -
RogerCosta - 15.09.2015
I updated samp includes, and error continues
Code:
#include <a_samp>
#include <weapon-config>
#include <SKY>
#include <zcmd>
#include <sscanf2>
#include <foreach>
#include <SII>
#include <cpstream>
#include "../include/gl_common.inc"
Line of error (
in red):
Code:
#if defined _ALS_OnPlayerDamage
#undef OnPlayerDamage
#else
#define _ALS_OnPlayerDamage
#endif
#define OnPlayerDamage WC_OnPlayerDamage
#if defined WC_OnPlayerDamage
forward WC_OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart);
#endif
If i don't use OnPlayerDamage, and run F5 for compile, compile normally. But, i put OnPlayerDamage, and f5 for compile, show error above
*Sorry for my bad english
Re: weapon-config.inc - Damage system with many features -
Slice - 15.09.2015
Show me your OnPlayerDamage, OnPlayerWeaponShot, OnPlayerDamageDone
Re: weapon-config.inc - Damage system with many features -
RogerCosta - 15.09.2015
Edit: OnPlayerDamage and OnPlayerDamageDone is empty, and OnPlayerWeaponShot i don't use in my script.
Код:
public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart)
{
return 1;
}
public OnPlayerDamage(playerid, Float:amount, issuerid, weapon, bodypart)
{
return 1;
}
Re: weapon-config.inc - Damage system with many features -
IzadorO - 16.09.2015
EDIT: Never mind figured it out.