Comando para profissгo! -
DarkZin - 09.12.2016
PHP код:
CMD:transportarvalores(playerid)
{
if(Profissao[playerid] == CarroForte)
SendClientMessage(playerid, -1, "Vocк Executou O Primeiro Comando!");
{
SendClientMessage (playerid, -1, " Vocк nгo tem permissгo!");
}
return 1;
}
Como crio uma condiзгo ai nesse cуdigo? Tipo, se o player nгo for da profissгo Carro Forte, ele nгo terб o comando Transportar Valores disponнvel. Eu atй tentei fazer antes de vim aqui, mais nгo consegui! Me ajudem pf!
Re: Comando para profissгo! -
Eddye - 09.12.2016
PHP код:
CMD:transportarvalores(playerid)
{
if(Profissao[playerid] == CarroForte)
{
SendClientMessage(playerid, -1, "Vocк Executou O Primeiro Comando!");
} else {
SendClientMessage (playerid, -1, " Vocк nгo tem permissгo!");
}
return 1;
}
ou se preferir:
PHP код:
CMD:transportarvalores(playerid)
{
if(Profissao[playerid] != CarroForte) return SendClientMessage (playerid, -1, " Vocк nгo tem permissгo!");
// Resto do comando..
return true;
}
Re: Comando para profissгo! -
DarkZin - 09.12.2016
Mano, nгo vai. Ele executa o comando transportavalores mesmo nгo sendo da profissгo carro forte, o que fiz de errado?
PHP код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#define CarroForte 0
#define C.CarroForte 0xCD00CDFF
new Profissao [MAX_PLAYERS];
E abaixo as condiзхes. No CMD carroforte, ele entra na prof. No outro abaixo, quero criar a condiзгo para usa o comando transportar valores apenas se ele estiver na profissгo, mais nгo vai.
PHP код:
CMD:carroforte(playerid)
{
if(Profissao[playerid] == CarroForte)
SendClientMessage(playerid,-1,"Bem vindo a transportadora de Valores de Las venturas!'");
SetPlayerColor (playerid, 0xCD00CDFF);
return 1;
}
CMD:transportarvalores(playerid)
{
if(Profissao[playerid] == CarroForte)
{
SendClientMessage(playerid, -1, "Bem vindo!!");
} else {
SendClientMessage (playerid, -1, " Vocк nгo tem permissгo!");
}
return 1;
}
Re: Comando para profissгo! -
SmokiieGamer - 09.12.2016
Tente.
PHP код:
new CarregarCarro[MAX_PLAYERS] = 0;
CMD:carregar(playerid)
{
if(Profissao[playerid] == CarroForte) // Profissao
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // estar em condutor
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 428) // VEICULO CARRO FORTE
{
if (PlayerToPoint(playerid, 10.0, /*Localizacao de carregar*/))
{
if(CarregarCarro[playerid] == 0)// caso ainda nao tiver carregado
{
new StringCat[700];
strcat(StringCat, "{FFFFFF}Localizacao 1 {00C9FF}» {FF0000}R$Dinheiro\n");
strcat(StringCat, "{FFFFFF}Localizacao 2{00C9FF}» {FF0000}R$Dinheiro\n");
strcat(StringCat, "{FFFFFF}Localizacao 3{00C9FF}» {FF0000}R$Dinheiro\n");
strcat(StringCat, "{FFFFFF}Localizacao 1{00C9FF}» {FF0000}R$Dinheiro");
ShowPlayerDialog(playerid, Dialog_CarroForte, DIALOG_STYLE_LIST, "{00C9FF}Carro Forte", StringCat, "Continuar", "Fechar");
return 1;
}
else SendClientMessage(playerid, 0xFF0000FF, "O seu Carro forte jб estб carregado!");
return 1;
}
else SendClientMessage(playerid, 0xFF0000FF, "Vocк nгo estб na бrea de carregamento!");
return 1;
}
else SendClientMessage(playerid, 0xFF0000FF, "Vocк nгo estб no veiculo da Profissгo!");
return 1;
}
else SendClientMessage(playerid, 0xFF0000FF, "Vocк nгo estб dirigindo um veнculo!");
return 1;
}
else SendClientMessage(playerid, 0xFF0000FF, "Vocк nгo tem permissгo!");
return 1;
}