08.10.2013, 14:35
1. I've two ways.
First:
Second:
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).
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.
First:
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_PASSENGER ) SetPlayerArmedWeapon( playerid, 0 );
return 1;
}
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;
}
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;
}
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.