08.11.2013, 10:30
remember to recharge the animation or nothing will happen.
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid){
if(issuerid != INVALID_PLAYER_ID && weaponid == 41 && IsPlayerCop(playerid)){
SetPlayerDrunkLevel(playerid, 50000);
ApplyAnimation(playerid,"CRACK","null",4.0,0,0,0,0,0,0);
ApplyAnimation(playerid,"CRACK","crckdeth1",4.0,0,0,0,0,0,0);
}
return 1;
}
public OnGameModeInit(){
SetTimer("RemoveEffect",1000,true);
return 1;
}
forward RemoveEffect();
public RemoveEffect(){
for(new i, t=GetMaxPlayers(); i<t; i++){
if(GetPlayerDrunkLevel(i) > 0){
SetPlayerDrunkLevel(i,GetPlayerDrunkLevel(i)-100);
return 1;
}
if(GetPlayerDrunkLevel(i) < 0){
SetPlayerDrunkLevel(i,0);
return 1;
}
}
return 1;
}

