SA-MP Forums Archive
[Ajuda] Portгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Portгo (/showthread.php?tid=579920)



Portгo - Andelux - 30.06.2015

Ola tenho 1 portao e queria colocar a permissao... por exemplo somente o player Andelux possa abrir o portao, ta ai o code :



new portao; // CRIA A ARRAY portao

public OnGameModeInit()
{
portao = CreateObject(980, 1185.0000000, -1730.6000000, 15.3000000, 0.0000000, 0.0000000, 0.0000000); // CRIA O OBJETO E O DEFINE COMO portao
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/abrir", true) == 0)
{
MoveObject(portao, 1185.0000000, -1730.5999755859, 19.89999961853, 3.0); // MOVE O PORTAO PARA AS COORDENADAS X, Y, Z NA VELOCIDADE W
SendClientMessageToAll(0xFFFF00FF, "O portгo foi aberto !");
return 1;
}
if(strcmp(cmdtext, "/fechar", true) == 0)
{
MoveObject(portao, 1185.0000000, -1730.6000000, 15.3000000, 3.0); // MOVE O PORTAO PARA AS COORDENADAS X, Y, Z NA VELOCIDADE W
SendClientMessageToAll(0xFFFF00FF, "O portгo foi fechado !");
return 1;
}
return 0;
}


Re: Portгo - iTakelot - 30.06.2015

Cria uma varialvel no comando.


Re: Portгo - FallweN - 30.06.2015

PHP код:
new portao; // CRIA A ARRAY portao
public OnGameModeInit()
{
    
portao = CreateObject(980, 1185.0000000, -1730.6000000, 15.3000000, 0.0000000, 0.0000000, 0.0000000);
    return 
1;
}
public 
OnPlayerCommandText(playerid, cmdtext[])
{
    if(
strcmp(cmdtext, "/abrir", true) == 0)
    {
        new 
Name[24];
        
GetPlayerName(playerid, Name, sizeof(Name));
        if(
strcmp(Name, "Andelux", false))
        {
            
MoveObject(portao, 1185.0000000, -1730.5999755859, 19.89999961853, 3.0);
            
SendClientMessageToAll(0xFFFF00FF, "O portгo foi aberto !");
        }
        else
            return 
SendClientMessage(playerid, 0xFFFF00FF, "Vocк nгo tem permiзгo para abrir o portгo");
        return 
1;
    }
    if(
strcmp(cmdtext, "/fechar", true) == 0)
    {
        new 
Name[24];
        
GetPlayerName(playerid, Name, sizeof(Name));
        if(
strcmp(Name, "Andelux", false))
        {
            
MoveObject(portao, 1185.0000000, -1730.6000000, 15.3000000, 3.0);
            
SendClientMessageToAll(0xFFFF00FF, "O portгo foi fechado !");
        }
        else
            return 
SendClientMessage(playerid, 0xFFFF00FF, "Vocк nгo tem permiзгo para abrir o portгo");
        return 
1;
    }
    return 
0;
} 
Espero ter ajudado


Re: Portгo - Andelux - 30.06.2015

Em NAME eu posso colocar por exemplo uma org?


Re: Portгo - ipsLuan - 30.06.2015

Quote:
Originally Posted by Andelux
Посмотреть сообщение
Em NAME eu posso colocar por exemplo uma org?
Lуgico, basta fazer a verificaзгo.

PHP код:
if(PlayerInfo[playerid][pOrg] == 15)