SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 04/09/2014, 05:36 PM   #1
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,570
Reputation: 332
Default Dominar

Bom, como que faz pra o cara dominar se estiver apenas 5 pessoas junto com ele...
Existe uma função pra isso?

Grato,
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 04/09/2014, 06:37 PM   #2
Skash
Big Clucker
 
Join Date: Aug 2012
Posts: 56
Reputation: 6
Default Re: Dominar

Por exemplo, 5 players da mesma equipe juntos ?
pawn Code:
new jogador[MAX_PLAYERS], quantos[MAX_PLAYERS];

foreach(Player, i)
{

if(IsPlayerInRangeOfPoint(i, 7.0, 2695.6880, -1704.6300, 11.8438)) // Um Exemplo
{

if(quantos[GetPlayerTeam(i)] < 5)
{

if(jogador[i] < 1)
{
jogador[i]++;

quantos[GetPlayerTeam(i)] ++;

}

}

if(quantos[GetPlayerTeam(i)] == 5)
{
// Acontecia a Dominação
}

}

}

SetPlayerTeam: http://wiki.sa-mp.com/wiki/SetPlayerTeam
GetPlayerTeam: http://wiki.sa-mp.com/wiki/GetPlayerTeam

Obs: Esse é um exemplo bastante simples!

Não sei se funcionaria amigo mas, não custa tentar, certo ?

Abraçs!
Skash is offline   Reply With Quote
Old 05/09/2014, 11:39 AM   #3
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,570
Reputation: 332
Default Re: Dominar

Será que tem um outro jeito pra fazer isto?
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 05/09/2014, 12:50 PM   #4
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: Dominar

Uma função rápida
pawn Code:
GetPlayersInRadius(playerid, Float:VBRaio)
{
    new VBCount, Float:VBPos[3];
    GetPlayerPos(playerid, VBPos[0], VBPos[1], VBPos[2]);
    for(new v, b = GetMaxPlayers(), v != b; v++)
        if(IsPlayerInRangeOfPoint(v, VBRaio, VBPos[0], VBPos[1], VBPos[2]))
            if(GetPlayerTeam(playerid) == GetPlayerTeam(v))
                VBCount++;

    return VBCount;
}

//Uso
if(GetPlayersInRadius(playerid, 10.0) > 4)
 //Continua dominando
__________________



CONTATO: F A C E B O O K: @vinibornpawn


Last edited by ViniBorn; 27/03/2017 at 02:59 AM.
ViniBorn is offline   Reply With Quote
Old 05/09/2014, 01:01 PM   #5
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,570
Reputation: 332
Default Re: Dominar

E se for pra um determinado local?
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 05/09/2014, 01:03 PM   #6
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: Dominar

IsPlayerInRangeOfPoint tá ali pra isso
__________________



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn is offline   Reply With Quote
Old 05/09/2014, 01:10 PM   #7
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,570
Reputation: 332
Default Re: Dominar

Eu digo assim, se ele estiver nas coordenadas 1, 2, 3 (X, Y, Z)?
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 05/09/2014, 01:19 PM   #8
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: Dominar

IsPlayerInRangeOfPoint verifica exatamente isso, X, Y e Z
__________________



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn is offline   Reply With Quote
Old 05/09/2014, 01:23 PM   #9
ipsLuan
High-roller
 
ipsLuan's Avatar
 
Join Date: Feb 2013
Location: Ilhéus, BA
Posts: 4,570
Reputation: 332
Default Re: Dominar

Então eu teria que editar a VBPos?
__________________

Precisando de algum sistema? Chame!

ipsLuan is offline   Reply With Quote
Old 05/09/2014, 01:26 PM   #10
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: Dominar

Você pode modificar essa função, e colocar X, Y e Z como parâmetro, em vez de usar GetPlayerPos, como eu fiz
__________________



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn 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] Dominar Cidiei Português/Portuguese 3 10/05/2014 11:57 PM
[Pedido] /dominar RockstarVidaloka Português/Portuguese 1 02/12/2013 12:56 PM
[Pedido] /dominar e /ao xxRaioxx Português/Portuguese 24 14/08/2013 09:09 PM
[Ajuda] /dominar... HarryPoter(Owner) Português/Portuguese 4 31/05/2013 05:22 AM
[Ajuda] /dominar bug The_MentalistRSF Português/Portuguese 4 05/05/2013 05:40 AM


All times are GMT. The time now is 10:13 AM.


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