[Ajuda] Comando
#1

Queria que os players sу pudessem usar esse comando depois de escolher a profissгo e tal..
Quote:

COMMAND:resgate(playerid, params[])
{
// Send the command to all admins so they can see it
SendAdminText(playerid, "/resgate", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player has a wanted level of less than 3
if (GetPlayerWantedLevel(playerid) < 3)
{
// Check if the player isn't in jail
if (APlayerData[playerid][PlayerJailed] == 0)
{
if (APlayerData[playerid][JobStarted] == false)
{
// Make sure you can't use "/rescue" when you're inside a vehicle (doesn't respawn you at the requested coords
// and puts a random item (bottle, sigarette, ...) in the player's hands
if (GetPlayerVehicleID(playerid) == 0)
{
// Create a dialog based on the player's class
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver: // Ask where the trucker player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Local do Resgate:", "Fallen Tree\r\nDeserto\r\nLVA Freight\r\nFoster Valley\r\nEl Corona\r\nLas Payasdas\r\nDoherty\r\nShady Creek\r\nPosto BR\r\nConference\r\nRed County\r\nAmtrak Rail\r\nQuarry Top\r\nBaySide\r\nHill Missionary", "Spawn", "Cancelar");
case ClassBusDriver: // Ask where the busdriver wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Local do Resgate:", "Stop Taxi LS\r\nStop Taxi SF\r\nBase of Cabbie\r\nPoint of Cabbie SF\r\nPoint of Cabbie LV\r\nPoint of Cabbie LS", "Spawn", "Cancelar");
case ClassPilot: // Ask where the pilot wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Local do Resgate:", "Aeroporto Eduardo Gomes(LS)\r\nAeroporto Galeao(SF)\r\nAeroporto Santos Dumont(LV)\r\nAeroporto Abandonado\r\nAeroporto de Easter Bay", "Spawn", "Cancelar");
case ClassPolice: // Ask where the police player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Local do Resgate:", "Delegacia de Los Santos\r\nDelegacia de San Fierro\r\nDelegacia de Las Venturas\r\nDelegacia de Fort Carson", "Spawn", "Cancelar");
case ClassCourier: // Ask where the courier player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Local do Resgate:", "Deposito de Los Santos\r\nDeposito de San Fierro\r\nDeposito Las Venturas\r\nDeposito de Trash", "Spawn", "Cancelar");
case ClassMafia: // Ask where the courier player wants to respawn
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Escolha o Local do Resgate:", "Yakuza\r\nAl Qaeda", "Spawn", "Cancelar");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "Voce nao Pode usar /resgate dentro de um Veiculo"); // "/rescue" doesn't work inside a vehicle
}
else
SendClientMessage(playerid, 0xFF0000FF, "Voce nao pode usar /resgate, voce Esta Realizando um Trabalho"); // "/rescue" doesn't work during a job
}
else
SendClientMessage(playerid, 0xFF0000FF, "Voce nao Pode usar /resgate Preso");
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Voce nao Pode usar /resgate quando Esta sendo Procurado");
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}

Reply
#2

1 unica profissao ou todas ?
Reply
#3

Todas, ou sу mafia e policial
Reply
#4

Este GameMode e o PPC_Trucking , vocК precisa fazer algo mais genial !
Exemplo usa sua logica e faзa uma variavel (Bool) , quando ele conecta setar a false , e assim que ele escolher a classe setar a false !
Ai no comando e so adicionar assim por evxemplo:
pawn Код:
if(MinhaVar[playerid] == false)return true;
Pronto resolveria seu problema!
Reply
#5

Cara entenda eu tou entendendo assim oque vc escreveu (bulufa de gol loko bife), eu sou novato nesse negocio samp faz 3 semanas que tou mechendo com isso tente falar do jeito que eu entenda..
Reply
#6

Quote:
Originally Posted by ThiagoMK
Посмотреть сообщение
Cara entenda eu tou entendendo assim oque vc escreveu (bulufa de gol loko bife), eu sou novato nesse negocio samp faz 3 semanas que tou mechendo com isso tente falar do jeito que eu entenda..
Tente estudar um pouco sobre bool
Reply
#7

Seria mais facil assim

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[]){
    if(GetPVarInt(playerid,"Escolhendo_Classe")==1){
    SendClientMessage(playerid, 0xFF0000FF, "{D7D7D7}Vocк nгo estб logado!");
    return 0;
    }
    return 1;
}
public OnPlayerSpawn(playerid)
{
    SetPVarInt(playerid,"Escolhendo_Classe",0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)