SA-MP Forums Archive
[ajuda] problema sem explicaзгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda] problema sem explicaзгo (/showthread.php?tid=278270)



[ajuda] problema sem explicaзгo - Skoll - 21.08.2011

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;
}



Re: [ajuda] problema sem explicaзгo - Skoll - 21.08.2011

#up#


Respuesta: [ajuda] problema sem explicaзгo - [FeK]Gunner - 21.08.2011

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


Re: [ajuda] problema sem explicaзгo - Skoll - 21.08.2011

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