headshot system problem
#1

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        if(
weaponid == 34 && bodypart == 9)
        {
            if(
GOD[playerid] == || GetPVarInt(playerid"aGod") == 0)
            {
                
GameTextForPlayer(issuerid,"~r~Headshot",2000,3) && GameTextForPlayer(playerid,"~r~Headshot",2000,3);
                
PlayerPlaySound(playerid178020.00.00.0)  && PlayerPlaySound(issuerid178020.00.00.0);
                
SetPlayerHealth(playerid0.0);
            }
        }
    }
    return 
1;

the problem I persist is that,if the playerid is on god mode,issuerid still can kill them
Reply
#2

Have you tried changing your operator? Try using (if i'm wrong correct me please - just trying to help)

PHP код:
if(GOD[playerid] != || GetPVarInt(playerid"aGod") != 1
Reply
#3

PHP код:
 if(GOD[playerid] == || GetPVarInt(playerid"aGod") == 0
The problem is in this

Add this

PHP код:
 if(GOD[playerid] == || GetPVarInt(playerid"aGod") == 1
And then compile it, it will work. If I solved your problem, then please rep+
Reply
#4

You had to use && instead || so it should be like this:
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart

    if(
issuerid != INVALID_PLAYER_ID
    { 
        if(
weaponid == 34 && bodypart == 9
        { 
            if(
GOD[playerid] == && GetPVarInt(playerid"aGod") == 0
            { 
                
GameTextForPlayer(issuerid,"~r~Headshot",2000,3) && GameTextForPlayer(playerid,"~r~Headshot",2000,3); 
                
PlayerPlaySound(playerid178020.00.00.0)  && PlayerPlaySound(issuerid178020.00.00.0); 
                
SetPlayerHealth(playerid0.0); 
            } 
        } 
    } 
    return 
1

Reply
#5

Quote:
Originally Posted by jlalt
Посмотреть сообщение
You had to use && instead || so it should be like this:
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart

    if(
issuerid != INVALID_PLAYER_ID
    { 
        if(
weaponid == 34 && bodypart == 9
        { 
            if(
GOD[playerid] == && GetPVarInt(playerid"aGod") == 0
            { 
                
GameTextForPlayer(issuerid,"~r~Headshot",2000,3) && GameTextForPlayer(playerid,"~r~Headshot",2000,3); 
                
PlayerPlaySound(playerid178020.00.00.0)  && PlayerPlaySound(issuerid178020.00.00.0); 
                
SetPlayerHealth(playerid0.0); 
            } 
        } 
    } 
    return 
1

Question

Shouldn't it be working with || or && (any of these <-)? Considering || (or) and && (and)
Reply
#6

Quote:
Originally Posted by UnGodly
Посмотреть сообщение
Question

Shouldn't it be working with || or && (any of these <-)? Considering || (or) and && (and)
he got two god checkers so that mean he got two god commands for ex: /god and /sgod [ simple god ]
if you want to check if player isn't in god mode you gotta check both before saying he is not god so yeah you have to use &&, || mean or so you have to be on both of god mods to avoid head shots...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)