[ajuda] GPS(checkpoint)
#6

pawn Код:
#define DIALOG_GPS      1

new PossuiGps[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/cgps", true) == 0)
    {
        PossuiGps[playerid] = 1;
        SendClientMessage(playerid,AMARELO,"(AVISO) Vocк comprou um GPS, digite /gps para usa-lo");
        return 1;
    }
   
    if(strcmp(cmd, "/gps", true) ==0)
    {
        if(PossuiGps[playerid] == 1)
        {
            ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST, "Escolha o seu trajeto:", "San Fierro Police Department \r\nSan Fierro Taxi Department \r\nSan Fierro Mecanichal Department \r\nCarrie of Trucker\r\nSan Fierro Medical Center", "Escolher", "Cancelar");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,VERMELHO,"(ERROR) Vocк ainda nгo possui um GPS, vб ate a ---- para compra-lo");
            return 1;
        }
    }
   
    return SendClientMessage(playerid, BRANCO,"Comando desconhecido, digite /comandos para ver os comandos");
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_GPS)
    {
        if(response) //pera um segundo vou dar uma olhada em uns scripts meus sim =)
        {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerCheckpoint(playerid, 1543.8772,-1676.4253,13.5573,8.0);
                    SendClientMessage(playerid, AMARELO, "(AVISO) Segue a ponto vermelho no mapa...");
                    return 1;
                }

                case 1:
                {
                    SetPlayerCheckpoint(playerid, 1543.8772,-1676.4253,13.5573,8.0);
                    SendClientMessage(playerid, AMARELO, "(AVISO) Segue a ponto vermelho no mapa...");
                    return 1;
                }

                case 2:
                {
                    SetPlayerCheckpoint(playerid, 1543.8772,-1676.4253,13.5573,8.0);
                    SendClientMessage(playerid, AMARELO, "(AVISO) Segue a ponto vermelho no mapa...");
                    return 1;
                }

                case 3:
                {
                    SetPlayerCheckpoint(playerid, 1543.8772,-1676.4253,13.5573,8.0); //pera.. yees ow mais tipo nem o SendClientMessage aparece entende... ?
                    SendClientMessage(playerid, AMARELO, "(AVISO) Segue a ponto vermelho no mapa...");
                    return 1;
                }
            }
        }
    }
    return 0;
}
Deve Funcionar. Joker, aproveite que ainda estб comeзando e passe a indentar teu cуdigo, olhe como estava antes e olhe como eu indentei, estб muito mais fбcil pra ler, tanto pra vocк como para o compilador.
Reply


Messages In This Thread
[ajuda] GPS(checkpoint) - by JOKERBOY - 27.04.2011, 00:16
Re: [ajuda] GPS(CHECKPOINT) - by ASDF - 27.04.2011, 00:27
Re: [ajuda] GPS(CHECKPOINT) - by Josma_cmd - 27.04.2011, 00:32
Re: [ajuda] GPS(CHECKPOINT) - by JOKERBOY - 27.04.2011, 00:33
Re: [ajuda] GPS(CHECKPOINT) - by JonathanFeitosa - 27.04.2011, 09:59
Re: [ajuda] GPS(CHECKPOINT) - by [BEP]AcerPilot - 27.04.2011, 14:36

Forum Jump:


Users browsing this thread: 1 Guest(s)