[Include] weapon-config.inc - Damage system with many features

Quote:
Originally Posted by RogerCosta
Посмотреть сообщение
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;
}
Your OnPlayerDamage is wrong..

pawn Код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
The reason the ampersands are there (&) is you can edit all arguments.

For example, if you want to make interior damage reverse (if you damage someone in an interior, you will lose damage and not the other player) do this:

pawn Код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
    if (GetPlayerInterior(playerid) != 0 && issuerid != INVALID_PLAYER_ID) {
        new tmp = playerid;
        playerid = issuerid;
        issuerid = playerid;
    }

    return 1;
}
Reply

Thanks Slice. Compile normaly.

Other quenstion: my scripts int OnPlayerDeath, i move to OnPlayerDamageDone?

*I'm NikO from server GangZone Interior system
Reply

Quote:
Originally Posted by RogerCosta
Посмотреть сообщение
Thanks Slice. Compile normaly.

Other quenstion: my scripts int OnPlayerDeath, i move to OnPlayerDamageDone?

*I'm NikO from server GangZone Interior system
OnPlayerDeath is still called normally. OnPlayerDamageDone and OnPlayerDeath are two completely different callbacks. One is called when damaged is completely processed and the other is called when a death is processed.
Reply

I need have with these errors
pawno\include\weapon-config.inc(2824) : error 025: function heading differs from prototype
\pawno\include\weapon-config.inc(3071) : error 025: function heading differs from prototype

please help
Reply

Fixed Slice

Код:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
    if (GetPlayerInterior(playerid) != 0 && issuerid != INVALID_PLAYER_ID) {
        new tmp = playerid;
        playerid = issuerid;
        issuerid = tmp;
    }

    return 1;
}
Reply

Quote:
Originally Posted by Jerry[TH]
Посмотреть сообщение
I need have with these errors
pawno\include\weapon-config.inc(2824) : error 025: function heading differs from prototype
\pawno\include\weapon-config.inc(3071) : error 025: function heading differs from prototype

please help
Show your OnPlayer(Take/Give)Damage. Also, Weapon-Config adds OnPlayerDamage, this function replace Take/Give functions.

--

Link SKY plugin for Linux Server 0.3.7 R2-1, please? Or R2

*Sorry my bad english.
Reply

I'm having a lil' problem here, player picks pickup on death, how i can fix that? :/
Reply

Quote:
Originally Posted by blastdap
Посмотреть сообщение
I'm having a lil' problem here, player picks pickup on death, how i can fix that? :/
The player doesn't actually die, so pickups are able to be picked up by the "dead" player. The simplest solutions would be either spread the pickups out away from the player or create the pickups after the player has spawned. If I were you I would do the second one.
Reply

Or you can use "IsPlayerDying"
something like this
Code:
public OnPlayerPickUpPickup(playerid, pickupid){
if(IsPlayerDying(playerid)) return 0;

//all other things here
if(pickupid....)
return 1;
}
Reply

Quote:
Originally Posted by Slice
View Post
I tried to prevent them from being picked up, but it's rather tricky.

I would suggest you create the pickups in OnPlayerDeathFinished, instead of OnPlayerDeath.
Yea, i put it in this callback and now works like a charm ty again.

BTW, there some errors in WC's github page like:

Quote:
Code:
SetCustomFallDamageMachines(bool:toggle);
Toggle vending machines (they are removed and disabled by default)

and

Quote:
Code:
public OnPlayerDeathFinished(playerid);
When the death animation has finished and the player has been sent to respawn

Reply

Slice or Crayder, in OnPlayerPrepareDeath:
Code:
public OnPlayerPrepareDeath(playerid, animlib[32], animname[32], &anim_lock, &respawn_time)
{
    // P_SHOOTEDBODY detect bodypart player shooted, in OnPlayerDamageDone
    respawn_time = 5000;
    anim_lock = 1;
	if(PLAYER_INFO[playerid][P_SHOOTEDBODY] != -1)
	{
		if(PLAYER_INFO[playerid][P_SHOOTEDBODY] == SHOOTED_FRONT_CHEST)
		{
		    animlib = "PED";
		    animname = "KO_shot_stom";
		}
		else if(PLAYER_INFO[playerid][P_SHOOTEDBODY] == SHOOTED_FRONT_HEAD)
		{
		    animlib = "PED";
		    animname = "KO_shot_face";
		}
		else if(PLAYER_INFO[playerid][P_SHOOTEDBODY] == SHOOTED_FRONT_TORSO)
		{
		    animlib = "PED";
		    animname = "KO_shot_stom";
		}
		else if(PLAYER_INFO[playerid][P_SHOOTEDBODY] == SHOOTED_BACK_TORSO)
		{
		    animlib = "PED";
		    animname = "KO_skid_back";
		}
		else if(PLAYER_INFO[playerid][P_SHOOTEDBODY] == SHOOTED_BACK_HEAD)
		{
			animlib = "FINALE";
		    animname = "FIN_Land_Die";
		}
	}
	else
	{
		animlib = "PED";
	    animname = "KO_skid_back";
	}
	PLAYER_INFO[playerid][P_SHOOTEDBODY] = -1;
	return true;
}
Its correct? Or or I have to use ApplyAnimation (if yes, i don't understand options animlib[32] and animname[32] in functions)

---

Issue here: After player death (with killerid != INVALID_PLAYER_ID), server crashs. If i type /kill, set health to 0.0, dies normaly, and no crash. I put in pastebin my OnPlayerDeath, OnPlayerPrepareDeath, OnPlayerDamage(Done): http://pastebin.com/hEXwzW2u

i make comments in pastebin, ok?

Edit: i use SAMP Server Linux 0.3.7 R2-1 on my server.
Reply

Could you use crashdetect and show me the server log output?
Reply

Slice, can you add a function like TogglePlayerDamageInformer to show/hide the damage informer textdraws?
Reply

Quote:
Originally Posted by Slice
View Post
Could you use crashdetect and show me the server log output?
Yes, one moment.

Quote:
Originally Posted by ExTaZZ69
View Post
Slice, can you add a function like TogglePlayerDamageInformer to show/hide the damage informer textdraws?
SetDamageFeed(false); ?
Reply

Very nice include !
Reply

Quote:
Originally Posted by RogerCosta
View Post
SetDamageFeed(false); ?
Oh, thanks a lot . But i think is not per player function.
Reply

(Double post )
Reply

Quote:
Originally Posted by ExTaZZ69
View Post
Oh, thanks a lot . But i think is not per player function.
Indeed it isn't, I'm waiting for a per player function as well.
Reply

There's a button to make a pull request on GitHub. It's easy to add features!
Reply

Quote:
Originally Posted by Slice
View Post
There's a button to make a pull request on GitHub. It's easy to add features!
I might give it a go.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)