SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/04/2020, 05:37 PM   #1
CopKing123
Huge Clucker
 
CopKing123's Avatar
 
Join Date: Jan 2014
Location: K
Posts: 213
Reputation: 9
Default SetPlayerHealth problem with weapon-config

Hello everyone,
I have installed weapon-config in my script lately, it looks like everything else is working except for the Fall Damage and the SetPlayerHealth for some reason, I have a command /kill and it just returns "Unknown command", if SetPlayerHealth gets removed from it, it will work, but what's the point of having a /kill cmd without it lol.

If anyone could help/has any ideas on how to fix this, please give me a reply. Thank you

EDIT: I have searched weapon-config section but I didn't see anyone naming a fix to that
__________________
Youtube Channel

CopKing123 is offline   Reply With Quote
Old 16/04/2020, 06:43 PM   #2
David (Sabljak)
Huge Clucker
 
Join Date: Nov 2011
Posts: 342
Reputation: 18
Default Re: SetPlayerHealth problem with weapon-config

Did you put OnPlayerDamage

and remove OnPlayerGiveDamage & OnPlayerTakeDamage
David (Sabljak) is offline   Reply With Quote
Old 16/04/2020, 06:57 PM   #3
CopKing123
Huge Clucker
 
CopKing123's Avatar
 
Join Date: Jan 2014
Location: K
Posts: 213
Reputation: 9
Default Re: SetPlayerHealth problem with weapon-config

Yes I removed that, I have OnPlayerDamage, I realised that weapon-config doesn't let you SetPlayerHealth 0.0, it blocks it, from the include.
__________________
Youtube Channel

CopKing123 is offline   Reply With Quote
Old 16/04/2020, 09:27 PM   #4
David (Sabljak)
Huge Clucker
 
Join Date: Nov 2011
Posts: 342
Reputation: 18
Default Re: SetPlayerHealth problem with weapon-config

It's working for me, by default... what's with fall damage?
David (Sabljak) is offline   Reply With Quote
Old 16/04/2020, 11:02 PM   #5
CopKing123
Huge Clucker
 
CopKing123's Avatar
 
Join Date: Jan 2014
Location: K
Posts: 213
Reputation: 9
Default Re: SetPlayerHealth problem with weapon-config

Oh nevermind. I had some bugs in OnPlayerDamage, but now I fixed it. However, thank you David.
__________________
Youtube Channel

CopKing123 is offline   Reply With Quote
Old 01/06/2020, 10:42 AM   #6
Filbert
Huge Clucker
 
Join Date: May 2016
Posts: 251
Reputation: 1
Default Re: SetPlayerHealth problem with weapon-config

Quote:
Originally Posted by CopKing123 View Post
Oh nevermind. I had some bugs in OnPlayerDamage, but now I fixed it. However, thank you David.
Ey man, how did you fix it? I'm facing the same problem, fall damage and i couldnt use SetPlayerHealth.. it returns an unknown cmd. Here's my codes..

pawn Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weaponid, &bodypart)
{
    if(PlayerInfo[issuerid][HitSound] == 1) SetDamageSounds(0, 17802);
    if(PlayerInfo[playerid][God] == 1 || OnFly[playerid] == true) return 0;
    if(PlayerInfo[playerid][team] == PlayerInfo[issuerid][team] && InDuel[playerid] == 0 && InDuel[issuerid] == 0 && InDM[playerid] == 0 && InDM[issuerid] == 0 && !IsPlayerInEvent(playerid) && !IsPlayerInEvent(issuerid))
    {
        GameTextForPlayer(issuerid, "~<~ ~r~Team killing is not allowed ~>~", 1000, 5);
        return 0;
    }
    if(event_type == TDM && p_team[issuerid] == p_team[playerid] && InDuel[playerid] == 0 && InDuel[issuerid] == 0 && InDM[playerid] == 0 && InDM[issuerid] == 0)
    {
        GameTextForPlayer(issuerid, "~<~ ~r~Team killing is not allowed ~>~", 1000, 5);
        return 0;
    }
    return 1;
}

If i just use the
pawn Code:
if(PlayerInfo[playerid][God] == 1 || OnFly[playerid] == true) return 0;
only, i can take the fall damage, but still unknown command with SetPlayerHealth.
But if i add my full OnPlayerDamage() codes, it returns unknown cmd and couldnt take the fall dmg

Hope you'll help, thanks
Filbert 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
weapon-config problem nomadsocio Scripting Help 0 19/03/2020 07:26 PM
weapon-config.inc HELP Filbert Scripting Help 6 03/01/2020 10:11 PM
weapon-config problem AfiqIqbal Scripting Help 8 16/12/2019 06:47 AM
[Ajuda] weapon-config Tiu_DaColombia Português/Portuguese 0 05/08/2019 04:53 PM


All times are GMT. The time now is 12:18 AM.


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