[Ajuda] Portгo Automatico!
#1

pawn Код:
Valew Pela Ajuda Gente =)
Thanks for the trouble
Reply
#2

nimguem sabe ?
Reply
#3

Nao existe nenhum comando para o portao abrir ?
PHP код:
if (strcmp("/portao", cmdtext, true, 10) == 0)
if(
strfind(PlayerName(playerid), "jogador1", false) != -1 || strfind(PlayerName(playerid), "jogador2", false) != -1 || strfind(PlayerName(playerid), "jogador3", false) != -1)
VerificarPortao();
return 
1;
} 
Tente algo assim, adapte-o ao seu gamemode ou filterscript.
Reply
#4

Pow mais eu queria que tipo quando o jogador1 chegasse no portao abri-se, e quando o jogador1x chega-se ele continua-se fechadinho!
Reply
#5

PHP код:
#define FILTERSCRIPT
#include <a_samp>
new Portao;
public 
OnFilterScriptInit()
{
    
SetTimer("VerificarPortao", 1000, true);
    
Portao = CreateObject(980, -1530.2000, 481.6600, 8.9200, 0.00, 0.00, 0.00);
    return 
1;
}
forward VerificarPortao();
public 
VerificarPortao()
{
    new 
name[MAX_PLAYER_NAME+1];
    new 
Float:X, Float:Y, Float:Z;
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        
GetPlayerPos(i, X, Y, Z);
        if(
PlayerNoRaio(10, -1530.2000, 481.6600, 8.9200, i))
        {
            
GetPlayerName(i, name, sizeof(name));
            if(
strcmp(name,"Jogador1",true)==0 || strcmp(name,"Jogador2",true)==0 || strcmp(name,"Jogador3",true)==0)// modificacao feita aki 
            
{
                
MoveObject(Portao, -1520.2000, 481.6600, 8.9200, 8);
                
SetTimer("FecharPortao", 8000, true);
            }
        }
    }
    return 
1;
}
forward FecharPortao();
public 
FecharPortao()
{
    
MoveObject(Portao, -1530.2000, 481.6600, 8.9200, 8);
}
stock PlayerNoRaio(Float:range, Float:x2, Float:y2, Float:z2, playerid)
{
    new 
Float:X2, Float:Y2, Float:Z2;
    
GetPlayerPos(playerid, X2, Y2, Z2);
    
X2 -= x2, Y2 -= y2, Z2 -= z2;
    return ((
X2 * X2) + (Y2 * Y2) + (Z2 * Z2)) < (range * range);
} 
Corrigidoі
Reply
#6

pawn Код:
public VerificarPortao()
{
    new nome[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        GetPlayerPos(i, X, Y, Z);
        GetPlayerName(i, nome, sizeof(nome));
        if(PlayerNoRaio(10, -1530.2000, 481.6600, 8.9200, i))
        {
            if(!strcmp(nome, "jogador1", true) || !strcmp(nome, "jogador2", true) || !strcmp(nome, "jogador3", true))
            {
                MoveObject(Portao, -1520.2000, 481.6600, 8.9200, 8);
                SetTimer("FecharPortao", 8000, true);
            }
        }
    }
    return 1;
}
Reply
#7

pawn Код:
public OnPlayerUpdade(playerid){

    if(IsPlayerInRangeOfPoint(playerid, 10, -1530.2000, 481.6600, 8.9200))
    {
         MoveObject(Portao, -1520.2000, 481.6600, 8.9200, 8);
         SetTimer("FecharPortao", 8000, true);
    }
    return 1;
}
Reply
#8

Manos, usem IsPlayerInRangeOfPoint!
Reply
#9

Quote:
Originally Posted by Rodney_Francalim
Посмотреть сообщение
PHP код:
public VerificarPortao()
{
    new 
nome[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z;
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        
GetPlayerPos(i, X, Y, Z);
        
GetPlayerName(i, nome, sizeof(nome));//aki
        
if(PlayerNoRaio(10, -1530.2000, 481.6600, 8.9200, i))
        {
            
//poderia ser aki
            
if(!strcmp(nome, "jogador1", true) || !strcmp(nome, "jogador2", true) || !strcmp(nome, "jogador3", true))
            {
                
MoveObject(Portao, -1520.2000, 481.6600, 8.9200, 8);
                
SetTimer("FecharPortao", 8000, true);
            }
        }
    }
    return 
1;
} 
pra q pegar todos os nomes do servidor se vc pode pegar simplismente o nome dos players no raio do portao?
Reply
#10

Nao й todos eu queria que o Portao Abri-se altomatico so pra certos Jogadores sako ?

Sу que Automatico mesmo, sem comando!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)