[Ajuda] Comando De Vidat Facзгo
#1

Ola Estou Fazendo Um Gamemode Do 0 Ai Quero PerGunta Se Vcs Tem o Comando Eo Sistema de /Vidat Por Que N cONSIGO fAZER
Reply
#2

Como vocк quer o comando? Somente para uma organizaзгo?
Reply
#3

PHP код:
CMD:vidat(playerid)
{
    new 
string[128], Nome[MAX_PLAYER_NAME];
    if(
Player[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1"[ERRO]: Vocк nгo tem permissгo");//Aqui sua variavel de quem pode usar o comando
     
for(new 0<= MAX_PLAYERSi++)
     {
        if(
GetDistanceBetweenPlayers(playeridi) <= 50)
        if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
        {
            
SetPlayerHealth(i100);
            
format(stringsizeof(string), "%s deu vida para todos perto dele."Nome);
            
SendClientMessageToAll(-1string);
        }
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by DelK
Посмотреть сообщение
PHP код:
CMD:vidat(playerid)
{
    new 
string[128], Nome[MAX_PLAYER_NAME];
    if(
Player[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1"[ERRO]: Vocк nгo tem permissгo");//Aqui sua variavel de quem pode usar o comando
     
for(new 0<= MAX_PLAYERSi++)
     {
        if(
GetDistanceBetweenPlayers(playeridi) <= 50)
        if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
        {
            
SetPlayerHealth(i100);
            
format(stringsizeof(string), "%s deu vida para todos perto dele."Nome);
            
SendClientMessageToAll(-1string);
        }
    }
    return 
1;

Este comando й para dar vida aos que estгo ao redor, e algumas funзхes que estгo sendo utilizadas aн, necessitam de algumas definiзхes.

Quote:
Originally Posted by JuniorVintedoisGR
Посмотреть сообщение
Ola Estou Fazendo Um Gamemode Do 0 Ai Quero PerGunta Se Vcs Tem o Comando Eo Sistema de /Vidat Por Que N cONSIGO fAZER
Bom, isso vai depender de tudo que vocк queira...
Vк se deu certo aн
Se for para dar vida para todos da sua facзгo, independente de distвncia, a funзгo й essa:

PHP код:
enum PvsL
{
    
PLC,
    
LDR
};
new 
gangue[MAX_PLAYERS][PvsL];
CMD:vidat(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
gangue[i][PLC] == 1)
        {
            
SetPlayerHealth(i100);
        }
    }
    return 
1;

Agora, caso vocк queira que dк vida somente para os que forem de sua gangue ao seu redor... Vocк deve utilizar essa funзгo: (Utilizando o comando do DelK)

PHP код:
CMD:vidat(playerid)
{
    new 
string[128], Nome[MAX_PLAYER_NAME];
     for(new 
0<= MAX_PLAYERSi++)
     {
        if(
GetDistanceBetweenPlayers(playeridi) <= 50)
        if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
        {
            if(
gangue[i][PLC] == 1)
            {
                
SetPlayerHealth(i100);
                
format(stringsizeof(string), "%s deu vida para todos perto dele."Nome);
                
SendClientMessageToAll(-1string);
            }
        }
    }
    return 
1;
}
GetDistanceBetweenPlayers(playerid,playerid2)
{
    new 
Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new 
Float:tmpdis;
    
GetPlayerPos(playerid,x1,y1,z1);
    
GetPlayerPos(playerid2,x2,y2,z2);
    
tmpdis floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return 
floatround(tmpdis);

Reply
#5

Quote:
Originally Posted by fxckshzt
Посмотреть сообщение
Este comando й para dar vida aos que estгo ao redor, e algumas funзхes que estгo sendo utilizadas aн, necessitam de algumas definiзхes.



Bom, isso vai depender de tudo que vocк queira...
Vк se deu certo aн
Se for para dar vida para todos da sua facзгo, independente de distвncia, a funзгo й essa:

PHP код:
enum PvsL
{
    
PLC,
    
LDR
};
new 
gangue[MAX_PLAYERS][PvsL];
CMD:vidat(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
gangue[i][PLC] == 1)
        {
            
SetPlayerHealth(i100);
        }
    }
    return 
1;

Agora, caso vocк queira que dк vida somente para os que forem de sua gangue ao seu redor... Vocк deve utilizar essa funзгo: (Utilizando o comando do DelK)

PHP код:
CMD:vidat(playerid)
{
    new 
string[128], Nome[MAX_PLAYER_NAME];
     for(new 
0<= MAX_PLAYERSi++)
     {
        if(
GetDistanceBetweenPlayers(playeridi) <= 50)
        if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
        {
            if(
gangue[i][PLC] == 1)
            {
                
SetPlayerHealth(i100);
                
format(stringsizeof(string), "%s deu vida para todos perto dele."Nome);
                
SendClientMessageToAll(-1string);
            }
        }
    }
    return 
1;
}
GetDistanceBetweenPlayers(playerid,playerid2)
{
    new 
Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    new 
Float:tmpdis;
    
GetPlayerPos(playerid,x1,y1,z1);
    
GetPlayerPos(playerid2,x2,y2,z2);
    
tmpdis floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
    return 
floatround(tmpdis);

Bom mais ele estб criando do 0 e qualquer um que mexe com gm de facзгo reconhece essa funзгo.
Reply
#6

Quote:
Originally Posted by DelK
Посмотреть сообщение
Bom mais ele estб criando do 0 e qualquer um que mexe com gm de facзгo reconhece essa funзгo.
Eu mesmo nгo conhecia, vim conhecer e entender um dia desses
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)