[FilterScript] Sistema de GPS Avanзado
#1

Olб pessoal vim postar um sistema de GPS muito fбcil de usar.
Eu sei muito bem que existe varios filterscript como esse de dialog, so que nenhum e tгo simples e facil de usar como o meu, vejo varios script com quase mil linhas sem nenhum proposito.

Como ele funciona ?
Como todo GPS, o player digita /gps e aparece as listas dos gps

Funзхes:
Код:
GPS(nomete[], Float:xxxxx, Float:yyyyy, Float:zzzzzzz)
Como Adicionar um GPS ?
Код:
GPS(   NOME DO GPS",     CORDENADAS);
Ex:
pawn Код:
GPS(   "GPS",     1209.8090,-1751.8210,13.5937);
Quando a pessoa adiciona isso em filterscriptinit e automaticamente adicionado ao dialog : /gps

Entгo e isso.

Creditos: HigorOliver & um Tal de Drakon

pawn Код:
//==============================================================================
#include <a_samp>
#define FILTERSCRIPT
#define GPS_GPS 500
//==============================================================================
new id=-1;
new bool:InGPS[MAX_PLAYERS];
enum pgps
{
    NomeRoubo[100],
    Float:xp,
    Float:yp,
    Float:zp,
    ID
};
new Gps[GPS_GPS][pgps];
//==============================================================================
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Sistema de GPS BY:HIGOR");
    print("--------------------------------------\n");
//          Nome               CORDENADAS
    GPS(   "GPS",     1209.8090,-1751.8210,13.5937);

    return 1;
}


//==============================================================================
stock GPS(nomete[], Float:xxxxx, Float:yyyyy, Float:zzzzzzz)
{
    id++;
    format(Gps[id][NomeRoubo],100,"%s",nomete);
    Gps[id][xp] = xxxxx;
    Gps[id][yp] = yyyyy;
    Gps[id][zp] = zzzzzzz;
    Gps[id][ID] = id;
    return 1;
}

//==============================================================================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new msg[128];
    if(listitem == Gps[listitem][ID])
    {
        if(!response) return false;
        SetPlayerCheckpoint(playerid,Gps[listitem][xp],Gps[listitem][yp],Gps[listitem][zp]+1,2.0);
        InGPS[playerid] = true;
        format(msg, sizeof(msg), "Gps Esta localizando no mapa : %s", Gps[listitem][NomeRoubo]);
        SendClientMessage(playerid, 0xFFFFFFFF, msg);
        return 1;
    }
    return 0;
}


//==============================================================================
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/gps", true)) {
        new dados[1024];
        format(dados, 1024, "");
        for(new J=0;J<=id;J++) {
            format(dados,1024, "%s%s\n",dados,Gps[J][NomeRoubo]);
        }
        ShowPlayerDialog(playerid,256,DIALOG_STYLE_LIST, "GPS",dados,"listitem", "Fechar");
    }

    return 0;
}


//==============================================================================
public OnPlayerEnterCheckpoint(playerid)
{
    if(InGPS[playerid] == true)
    {
      DisablePlayerCheckpoint(playerid);
      InGPS[playerid] = false;
    }
    return 1;
}
Reply


Messages In This Thread
Sistema de GPS Avanзado - by [FeK]HigorOliver - 05.11.2010, 12:55
Re: Sistema de GPS Avanзado - by ipsBruno - 05.11.2010, 13:09
Re: Sistema de GPS Avanзado - by [FeK]HigorOliver - 05.11.2010, 13:22
Re: Sistema de GPS Avanзado - by TiagoPS - 05.11.2010, 13:44
Re: Sistema de GPS Avanзado - by zSuYaNw - 05.11.2010, 13:54
Re: Sistema de GPS Avanзado - by [FeK]HigorOliver - 05.11.2010, 14:17
Re: Sistema de GPS Avanзado - by [FeK]Falcon_Sixe - 05.11.2010, 15:56
Re: Sistema de GPS Avanзado - by KevinsL - 05.11.2010, 16:52
Re: Sistema de GPS Avanзado - by [FeK]HigorOliver - 05.11.2010, 20:46
Re: Sistema de GPS Avanзado - by zSuYaNw - 05.11.2010, 22:29

Forum Jump:


Users browsing this thread: 1 Guest(s)