Kick gun help! :D
#1

Hey there. I need a kick gun for fun but I do not know how to script the command to give yourself one but that's not the question. The question is when ANYONE fires a shotgun with this public variable in, it kicks them, not the person they fired it at. If you can help me create a command and or fix the variable it will be appreciated with a rep. Thanks!

Public Variable:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(GetPlayerWeapon(issuerid) == 25) return Kick(issuerid);
    return 1;
}
Reply
#2

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            if(GetPlayerWeapon(playerid) == 25)
            {
                Kick(playerid);
            }
        }
    }
    return 1;
}
This should work. If you only want it to kick them when they hit someone, then use this:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid == INVALID_PLAYER_ID) return 1;
    if(weaponid == 25) return Kick(issuerid);
    return 1;
}
Reply
#3

issuerid is the person shooting, if you wanna kick the person getting shot,

change Kick(issuerid);
to Kick(playerid);
Reply
#4

Quote:
Originally Posted by [FAT]Klabauter[LST]
Посмотреть сообщение
issuerid is the person shooting, if you wanna kick the person getting shot,

change Kick(issuerid);
to Kick(playerid);
Do you mind me asking why someone should kick a player who get shot? That would be unnecessary.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)