[Ajuda] Comando
#1

Galera por favor deixem esse comando sу para usar quando ja estiver logado e escolher a profissгo.. Por favor agradeзo

pawn Код:
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

vc quer que de pra usar se for um cara que trabalha nessa prof?
Reply
#3

O comando ja ta feito.. mais os cara fica usando ele sem nascer..
Eu queria que quando eles tentasse usar /resgate naquela tela de escolher a profissгo aparecesse uma mensagem tipo: [ERRO] Vocк ainda nгo nasceu.
Reply
#4

pawn Код:
new cLogado[MAX_PLAYERS];//no topo

cLogado[playerid] = 1;//em OnPlayerSpawn

cLogado[playerid] = 0;//em OnPlayerDisconnect

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(cLogado[playerid] == 0) return SendClientMessage(playerid,-1,"Vocк sу pode usar esse comando quando estiver dado spawn!");
    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
#5

Vou tentar aqui ****** se funfar eu edito
Reply
#6

****** deu 2 error, Se vc quiser instalar pra mim para ver melhor eu agradeзo skye: thiago.j.r ou se vocк me ajudar por aqui tbm ti agradeзo '-'
pawn Код:
error 017: undefined symbol "MAX_PLAYERS"
error 009: invalid array size (negative, zero or out of bounds)
Reply
#7

o MAX_PLAYERS esta INDEFINIDO
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)