Need help with Spawn campers/Knife animation/Score 0 bug Thanks
#3

1. I've two ways.

First:
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_PASSENGER ) SetPlayerArmedWeapon( playerid, 0 );
    return 1;
}
Second:
pawn Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
    if( newkeys & KEY_CROUCH && GetPlayerState( playerid ) == PLAYER_STATE_PASSENGER )
    {
        new
            vehicleid = GetPlayerVehicleID( playerid ),
            seat = GetPlayerVehicleSeat( playerid )
        ;
        RemovePlayerFromVehicle( playerid );
        PutPlayerInVehicle( playerid, vehicleid, seat );
    }
    return 1;
}
2. Actually team mates can kill players from their team with a knife; however, the player is not synced and as a result, it will be on the floor. That might be useful, you need to modify it though (I just gave you an example, you need to check if any player is in xy of the player (with the knife) and check if they're both at the same team etc).

pawn Код:
public OnPlayerUpdate( playerid )
{
    if( GetPlayerAnimationIndex( playerid ) )
    {
        new
            animlib[ 32 ],
            animname[ 32 ]
        ;
        GetAnimationName( GetPlayerAnimationIndex( playerid ), animlib, 32, animname, 32 );
        if( !strcmp( animlib, "KNIFE", true ) && !strcmp( animname, "KILL_PARTIAL", true ) )
        {
            ClearAnimations( playerid );
        }
    }
    return 1;
}
Or you can re-set player's position instead of clearing animations.

3. Do you save their statistics when they disconnect?

EDIT: Pottus, he means that when you enter as passenger in nrg-500 (or some other bike), it takes no damage.
Reply


Messages In This Thread
Need help with Spawn campers/Knife animation/Score 0 bug Thanks - by john77 - 08.10.2013, 14:26
Re: Need help with Spawn campers/Knife animation/Score 0 bug Thanks - by Scrillex - 08.10.2013, 14:28
Re: Need help with Spawn campers/Knife animation/Score 0 bug Thanks - by Konstantinos - 08.10.2013, 14:35
Re: Need help with Spawn campers/Knife animation/Score 0 bug Thanks - by Pottus - 08.10.2013, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)