SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 01/05/2019, 06:04 PM   #1
alexsandrofelix
Big Clucker
 
Join Date: Sep 2016
Posts: 53
Reputation: 0
Default Perder vida

Galera tem como fazer com que jogador pode vida ao entrar em uma gangzone ? se tive pode me arrumar uma base porfavor.
__________________
alexsandrofelix is offline   Reply With Quote
Old 01/05/2019, 06:14 PM   #2
LucasW
Huge Clucker
 
Join Date: Oct 2016
Posts: 217
Reputation: 0
Default Re: Perder vida

Você pode usar SetPlayerHealth
LucasW is offline   Reply With Quote
Old 01/05/2019, 06:33 PM   #3
alexsandrofelix
Big Clucker
 
Join Date: Sep 2016
Posts: 53
Reputation: 0
Default Re: Perder vida

mais como eu faria isso esatamento to com essa duvida tipo onde eu faria para verificar se jogador ta na gangzone
__________________
alexsandrofelix is offline   Reply With Quote
Old 01/05/2019, 06:47 PM   #4
LucasW
Huge Clucker
 
Join Date: Oct 2016
Posts: 217
Reputation: 0
Default Re: Perder vida

Você pode criar um public para perder a a vida atualizando com um settimer ai na gangzone você cola a função pra chama a public que vai dimunindo a vida
LucasW is offline   Reply With Quote
Old 01/05/2019, 06:59 PM   #5
PedroH
Huge Clucker
 
Join Date: Jul 2017
Posts: 337
Reputation: 5
Default Re: Perder vida

ta ai uma base:
pawn Code:
enum areas { Float:minX, Float:minY, Float:maxX, Float:maxY }

new areasRadioativas[][areas] =
{
    //x menor  y menor     x maior    y maior
    {#########, #########, #########, #########},
    {#########, #########, #########, #########},
    {#########, #########, #########, #########}
};

PHP Code:
forward checkArea(playerid);
public 
checkArea(playerid)
{
   if(
PlayerEstaNaGangZone(playerid))
        
SetPlayerHealth(playerid0.0);

PHP Code:
PlayerEstaNaGangZone(playerid)
{
    new 
Float:pPos[3];
    
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
    for(new 
i=0sizeof(areas) ;i++)
        if(
pPos[0] >= areas[i][minX] && pPos[0] <= areas[i][maxX] && pPos[1] >= areas[i][minY] && pPos[1] <= areas[i][maxY])
            return 
true;
    return 
false;

PHP Code:
OnPlayerSpawnSetTimerEx("checkArea"5000true"i"playerid); 

Last edited by PedroH; 03/05/2019 at 04:33 PM.
PedroH is offline   Reply With Quote
Old 03/05/2019, 04:37 AM   #6
alexsandrofelix
Big Clucker
 
Join Date: Sep 2016
Posts: 53
Reputation: 0
Default Re: Perder vida

vlw galera vou trabalhar na dica de voces tmj + reputaçao para voces tmj
__________________
alexsandrofelix is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Perder vida com o tempo F1N4L Português/Portuguese 7 27/11/2015 03:09 PM
[Pedido] Quando tiver na prisão não perder vida? AndersonAq Português/Portuguese 3 19/09/2013 12:47 AM
[Pedido] Player perder vida -30, 5 em 5 segundos [Dark]Danny_Uchiha Português/Portuguese 31 22/06/2013 06:32 PM
[ajuda] Perder vida ao bater no carro! biaamorin Português/Portuguese 22 17/03/2012 05:17 PM


All times are GMT. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.