[Ajuda] Portao
#6

Ajudei? + Reputaзгo

PHP код:
#include <a_samp>
/*-- Vбriaveis Globais --*/
new
    
portaocop,
    
parkinggate,
    
parkinggate2
    
;
/*-- Forwards --*/
forward portaoandando(playerid);
forward portaofechando();
forward ChecarPortao();
public 
OnGameModeInit()
{
    
/*-- Portхes --*/
    
portaocop CreateObject(980,898.50000000,-2262.30004883,14.80000019,0.00000000,0.00000000,279.99206543);
    
parkinggate CreateObject(980,866.59997559,-2258.80004883,15.00000000,0.00000000,0.00000000,10.00000000);
    
parkinggate2 CreateObject(980,855.09997559,-2189.89990234,15.60000038,0.00000000,0.00000000,8.00000000);
    
SetTimer("ChecarPortao",5000,false);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext,"/abrirestacionamento"true) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid,10.01,2,3)) /*-- Coloque aqui a cordenada do Portгo 1 --*/
        
{
            
MoveObject(parkinggate,866.59997559,-2258.80004883,9.19999981,0.97); /*-- 0.97 = Velocidade mude se quiser --*/
            
MoveObject(parkinggate2,855.09997559,-2189.89990234,9.80000019,0.97); /*-- 0.97 = Velocidade mude se quiser --*/
            
SetTimer("portaofechando",5000,false);/*-- Timer que fecharб o portгo em 5 segundos --*/
            
SendClientMessage(playerid,0xF60000AA,"Estacionamento Aberto, Fecharб em 5 Segundos!");
            return 
1;
        }
        else
        {
            
SendClientMessage(playerid, -1"[x] {FF0000}Vocк nгo estб a menos de 10 metros do portгo."); /*-- Se ele se afastar do portгo a mais de 10 metros o portгo fecharб --*/
        
}
        return 
1;
    }
    return 
0;
}
public 
ChecarPortao()
{
    for( new 
0<GetMaxPlayers( ) ; i++ )
    {
        if(
IsPlayerInRangeOfPoint(i,10.01,2,3)) /*-- Coloque aqui a cordenada do Portгo 1 --*/
        
{
            
MoveObject(portaocop,896.59997559,-2250.89990234,14.800000191.5); /*-- Se ele estiver a menos de 10 metros do portгo, o portгo abrirб --*/
        
}
        else
        {
            
MoveObject(portaocop,898.50000000,-2262.30004883,14.800000191.0); /*-- Se ele se afastar do portгo a mais de 10 metros o portгo fecharб --*/
        
}
    }
    return 
1;
}
public 
portaofechando()
{
    
MoveObject(parkinggate,866.59997559,-2258.80004883,15.000000001.5);
    
MoveObject(parkinggate2,855.09997559,-2189.89990234,15.600000381.0);
    return 
1;

Reply


Messages In This Thread
Portao - by .:LucasxD:. - 21.07.2012, 19:30
Re: Portao - by .:LucasxD:. - 21.07.2012, 20:12
Re: Portao - by .:LucasxD:. - 22.07.2012, 00:08
Re: Portao - by .:LucasxD:. - 22.07.2012, 19:19
Re: Portao - by [BOPE]Seu._.Madruga - 19.02.2014, 12:07
Re: Portao - by [BOPE]Seu._.Madruga - 19.02.2014, 12:32
Re: Portao - by Sky™ - 19.02.2014, 12:36
Respuesta: Portao - by [BWL]Chamaleon - 19.02.2014, 16:06

Forum Jump:


Users browsing this thread: 1 Guest(s)