Pomoc

Započeo Fr0z3n, Maj 01, 2020, 16:52:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Problem(error/warning): Kako da napravim da kada uradi c bug da mu se takodje i skine tipa 20hp probao sam sa Iz_SetPlayerHealth ali to nije to kao sto sam i ocekivao treba mi neki slap ali sam zaboravio kako to ide
Dio skripte:
    if((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH))
    {
        new weapon = GetPlayerWeapon(playerid);
        if(weapon == 22 || weapon == 24 || weapon == 25 || weapon == 27)
        {
            ApplyAnimation(playerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0);
            GameTextForPlayer(playerid, "~r~Prestani da radis c-bug!!", 2000, 1);
			lz_GivePlayerMoney(playerid, -5000);
			lz_SetPlayerHealth(playerid, 20.0);
			SCM(playerid, -1, "{F81414}[C-BUG]{FFFFFF}Oduzeto vam je 5000$ zato sto ste pokusali c-bug!");
        }
    }

Kod: [Izaberi]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Slika/video ingame problema(obavezno ako je ingame problem):
Poslednja Izmena: Maj 01, 2020, 19:47:06 POSLE PODNE od daddy.

Ako želiš da mu oduzme 20HPa evo:
if((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH))
    {
        new weapon = GetPlayerWeapon(playerid);
        if(weapon == 22 || weapon == 24 || weapon == 25 || weapon == 27)
        {
            new Float:helti;
            GetPlayerHealth(playerid,helti);
            ApplyAnimation(playerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0);
            GameTextForPlayer(playerid, "~r~Prestani da radis c-bug!!", 2000, 1);
			lz_GivePlayerMoney(playerid, -5000);
			lz_SetPlayerHealth(playerid, helti-20);
			SCM(playerid, -1, "{F81414}[C-BUG]{FFFFFF}Oduzeto vam je 5000$ zato sto ste pokusali c-bug!");
        }
    }

A kako mogu da napravim umesto ove animacije da ga freeza na tipa 2sec i onda da ga unfreeze? pokusao sam preko timera nekog ali ne ide

if((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH))
    {
        new weapon = GetPlayerWeapon(playerid);
        if(weapon == 22 || weapon == 24 || weapon == 25 || weapon == 27)
        {
            new Float:helti;
            GetPlayerHealth(playerid,helti);
            TogglePlayerControllable(playerid, false);
            SetTimerEx("UnfreezeIgraca", 2000, false, "i", playerid); 
            GameTextForPlayer(playerid, "~r~Prestani da radis c-bug!!", 2000, 1);
			lz_GivePlayerMoney(playerid, -5000);
			lz_SetPlayerHealth(playerid, helti-20);
			SCM(playerid, -1, "{F81414}[C-BUG]{FFFFFF}Oduzeto vam je 5000$ zato sto ste pokusali c-bug!");
        }
    }


forward UnfreezeIgraca(playerid);
public UnfreezeIgraca(playerid)
{
    return TogglePlayerControllable(playerid, true);
}

Sori sto smaram ali sto ne pise kad mu oduzme 20hp tipa splat -20.0 ili tako nesto?

Ubacis damage informer xDD