[ajuda] problema sem explicaзгo
#1

bom, eu criei um sistema que impede que o jogador vб no pay 'n' spray e aumente a vida do rc baron, ta funcionando, mas se a vida descer, ele tambem seta a vida pra 400, criando um sistema de god ao inves de anti-healthcar.
cуdigo:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    SetTimer("checkhealthcar", 2000, 1);
    if(newstate == PLAYER_STATE_ONFOOT)
    {
    if(IsPlayerInRangeOfPoint(playerid, 10, 1044.9265,1011.7687,55.3047)) return    SendClientMessage(playerid, COLOR_ADMIN, "Para usar el baron usa: /baron.");
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {                                                    
        SetPlayerArmedWeapon(playerid, 0);        /*ANTI*/
    }                                                   /*DRIVE-BY*/
    return 1;
}
forward checkhealthcar(playerid, vehicleid);
public checkhealthcar(playerid, vehicleid)
{
    if(!IsPlayerInVehicle(playerid, baron1)) return 1;
    GetVehicleHealth(baron1, healthcar);
    if(healthcar > 400) return 1;
    SetTimer("sethealth", 2000, 1);
    return 1;
}
Reply
#2

#up#
Reply
#3

pawn Код:
SetTimer("sethealth", 2000, 1);
Posta ae a public
pf.
Reply
#4

forward sethealth(vehicleid);
public sethealth(vehicleid)
{
SetVehicleHealth(baron1, 400);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)