#1

Quien me podrнa, decir como poner a funcionar el comando del GPS.

Si pudieran.
Reply
#2

No soy bueno explicando. pero hice este para q veas el codigo XD

PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define DIALOGO_GPS         100
enum Info
{
    
pGPS
};
new 
PlayerInfo[MAX_PLAYERS][Info];
main()
{
    print(
"\n----------------------------------");
    print(
" GPS by Alvaro");
    print(
"----------------------------------\n");
}
public 
OnPlayerConnect(playerid)
{
   
PlayerInfo[playerid][pGPS] = 0;
   return 
1;
}
CMD:comprargps(playeridparams[])
{
   if(
PlayerInfo[playerid][pGPS] < 1)
   {
      
PlayerInfo[playerid][pGPS] = 1;
      
SendClientMessage(playerid, -1"Compraste un gps por $500");
      
GivePlayerMoney(playerid, -500);
   }
   else
   {
      
SendClientMessage(playerid, -1" Ya tienes un gps. Para usarlo escribe /gps");
   }
   return 
1;
}
CMD:gps(playeridparams[])
{
   if(
PlayerInfo[playerid][pGPS] == 1)
   {
      
ShowPlayerDialog(playeridDIALOGO_GPSDIALOG_STYLE_LIST"GPS""Hospital de los Santos\nComisaria de los Santos\nTienda 24-7""Elegir""Cerrar");
   }
   else
   {
      
SendClientMessage(playerid, -1"No tienes un gps. para comprar uno, escribe /comprargps");
   }
   return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
   switch(
dialogid)
   {
      case 
DIALOGO_GPS:
      {
         switch(
listitem)
         {
            case 
0:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion del hospital de LS");
               
SetPlayerCheckpoint(playerid1181.2319 ,-1324.275313.58505.0);
            }
            case 
1:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion de la comisaria de ls");
               
SetPlayerCheckpoint(playerid1545.8949, -1675.659513.56135.0);
            }
            case 
2:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion de la Tienda 24/7");
               
SetPlayerCheckpoint(playerid1831.6049,-1842.8744,13.57815.0);
            }
         }
      }
   }
   return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    
SendClientMessage(playerid, -1"LLegaste a destino");
    
DisablePlayerCheckpoint(playerid);
    return 
1;

Reply
#3

Quote:
Originally Posted by Alvaro89
Посмотреть сообщение
No soy bueno explicando. pero hice este para q veas el codigo XD

PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define DIALOGO_GPS         100
enum Info
{
    
pGPS
};
new 
PlayerInfo[MAX_PLAYERS][Info];
main()
{
    print(
"\n----------------------------------");
    print(
" GPS by Alvaro");
    print(
"----------------------------------\n");
}
public 
OnPlayerConnect(playerid)
{
   
PlayerInfo[playerid][pGPS] = 0;
   return 
1;
}
CMD:comprargps(playeridparams[])
{
   if(
PlayerInfo[playerid][pGPS] < 1)
   {
      
PlayerInfo[playerid][pGPS] = 1;
      
SendClientMessage(playerid, -1"Compraste un gps por $500");
      
GivePlayerMoney(playerid, -500);
   }
   else
   {
      
SendClientMessage(playerid, -1" Ya tienes un gps. Para usarlo escribe /gps");
   }
   return 
1;
}
CMD:gps(playeridparams[])
{
   if(
PlayerInfo[playerid][pGPS] == 1)
   {
      
ShowPlayerDialog(playeridDIALOGO_GPSDIALOG_STYLE_LIST"GPS""Hospital de los Santos\nComisaria de los Santos\nTienda 24-7""Elegir""Cerrar");
   }
   else
   {
      
SendClientMessage(playerid, -1"No tienes un gps. para comprar uno, escribe /comprargps");
   }
   return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
   switch(
dialogid)
   {
      case 
DIALOGO_GPS:
      {
         switch(
listitem)
         {
            case 
0:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion del hospital de LS");
               
SetPlayerCheckpoint(playerid1181.2319 ,-1324.275313.58505.0);
            }
            case 
1:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion de la comisaria de ls");
               
SetPlayerCheckpoint(playerid1545.8949, -1675.659513.56135.0);
            }
            case 
2:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion de la Tienda 24/7");
               
SetPlayerCheckpoint(playerid1831.6049,-1842.8744,13.57815.0);
            }
         }
      }
   }
   return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    
SendClientMessage(playerid, -1"LLegaste a destino");
    
DisablePlayerCheckpoint(playerid);
    return 
1;

Gracias amigo
Reply
#4

Quote:
Originally Posted by Alvaro89
Посмотреть сообщение
No soy bueno explicando. pero hice este para q veas el codigo XD

PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define DIALOGO_GPS         100
enum Info
{
    
pGPS
};
new 
PlayerInfo[MAX_PLAYERS][Info];
main()
{
    print(
"\n----------------------------------");
    print(
" GPS by Alvaro");
    print(
"----------------------------------\n");
}
public 
OnPlayerConnect(playerid)
{
   
PlayerInfo[playerid][pGPS] = 0;
   return 
1;
}
CMD:comprargps(playeridparams[])
{
   if(
PlayerInfo[playerid][pGPS] < 1)
   {
      
PlayerInfo[playerid][pGPS] = 1;
      
SendClientMessage(playerid, -1"Compraste un gps por $500");
      
GivePlayerMoney(playerid, -500);
   }
   else
   {
      
SendClientMessage(playerid, -1" Ya tienes un gps. Para usarlo escribe /gps");
   }
   return 
1;
}
CMD:gps(playeridparams[])
{
   if(
PlayerInfo[playerid][pGPS] == 1)
   {
      
ShowPlayerDialog(playeridDIALOGO_GPSDIALOG_STYLE_LIST"GPS""Hospital de los Santos\nComisaria de los Santos\nTienda 24-7""Elegir""Cerrar");
   }
   else
   {
      
SendClientMessage(playerid, -1"No tienes un gps. para comprar uno, escribe /comprargps");
   }
   return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
   switch(
dialogid)
   {
      case 
DIALOGO_GPS:
      {
         switch(
listitem)
         {
            case 
0:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion del hospital de LS");
               
SetPlayerCheckpoint(playerid1181.2319 ,-1324.275313.58505.0);
            }
            case 
1:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion de la comisaria de ls");
               
SetPlayerCheckpoint(playerid1545.8949, -1675.659513.56135.0);
            }
            case 
2:
            {
               
SendClientMessage(playerid, -1"Se marco en el mapa la ubicacion de la Tienda 24/7");
               
SetPlayerCheckpoint(playerid1831.6049,-1842.8744,13.57815.0);
            }
         }
      }
   }
   return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    
SendClientMessage(playerid, -1"LLegaste a destino");
    
DisablePlayerCheckpoint(playerid);
    return 
1;

Amigo, como creo el archivo amx del scripts, que si me carga pero no me funciona.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)