23.12.2015, 17:15
PHP код:
if(HOLDING(KEY_SPRINT))
{
if(armytraining[playerid] == 1)
{
SetPlayerProgressBarValue(playerid,testbar[playerid],GetPlayerProgressBarValue(playerid,bar[playerid])+ 1);
UpdatePlayerProgressBar(playerid,testbar[playerid]);
if(GetPlayerProgressBarValue(playerid, testbar[playerid]) == 99)
{
GameTextForPlayer(playerid,"~r~MISSION FAILED",3000,5);
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/7o7bkddi9b/Tornado_Siren_II-Delilah-747233690.mp3");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
}
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
SetPlayerProgressBarValue(playerid,testbar[playerid],GetPlayerProgressBarValue(playerid,bar[playerid]) -1);
UpdatePlayerProgressBar(playerid,testbar[playerid]);
if(GetPlayerProgressBarValue(playerid, testbar[playerid]) == 0)
{
GameTextForPlayer(playerid,"~G~ keep stealth",3000,5);
}
}
}
}
If he stop, then it the progress bar should stop updating .
If he crouch, then the progress bar should be updated by removing - 1
With this way crouch is not working, plus holding key for sprint just updating + 1 only once ..