Jump to content

Cerere tutorial gps


GenOxigen

Recommended Posts

Mergi prima data pe server la locatia dorita, dai /save si ai salvat coordonatele .

 

Apoi , intri pe server , faci un define pe la inceput ca sa nu-ti bati prea mult capul . Define-ul sa fie ceva de genul #define DIALOG_GPS 223 .

 

Mergi la public OnPlayerCommandText iar acolo, dupa ce comanda vrei tu adaugi asa : 

if(strcmp(cmd, "/gps", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		    ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST, "Alege o locatie in care vrei sa mergi", "1.Spawn Civili", "Alege", "Inchide");
		}
		return 1;
	}

Spawn Civil arata locatia, tu pui ce vrei, cum vrei dar trebuie sa ai grija cum le asezi ! 

In loc de DIALOG_GPS pui ce #define ai pus tu .

 

Asa, apoi , dupa ce ai adaugat comanda mergi la public OnDialogResponse si inainte de primul dialog sau dupa ultimul adaugi asa : 

if(dialogid == DIALOGGPS)
		{
			if(response)
			{
			    if(listitem==0)
			    {
			        SetPlayerCheckpoint(playerid, coordonatele zonei unde ai dat /save, 3);
			        SendClientMessage(playerid, COLOR_BLUE, "Ai activat GPS-ul, mergi la punctul rosu de pe harta !");
				}

In loc de DIALOG_GPS pui cum ai definit tu cu #define .

 

Pentru a dezactiva checkpoint-ul cand ajunge la destinatie fa asa : mergi la public OnPlayerEnterCheckpoint si adaugi 

if PlayerToPoint(5,playerid,coordonatele zonei unde ai dat /save)
	*then
	{
	    DisablePlayerCheckpoint(playerid);
	    SendClientMessage(playerid, COLOR_ORANGE, "Ai ajuns la destinatie, GPS-ul a fost dezactivat!");
	}

si cam asta e . Sper sa intelegi si sa te descurci . Este foarte simplu . Pentru fiecare locatie adaugata, la dialog dupa "1.Spawn Civili" de exemplu adaugi n2.Locatie, iar linia va arata ceva gen 1.Spawn Civilin2.Locatia pe care o vrei, iar la ondialogresponse, in loc de listitem 0 adaugi 1 , adica listitem 1 , la urmatorul listitem 2 si tot asa . Bafta !

Link to comment
Share on other sites

Am inteles inafara de chestia aia cu define 

Pui la inceputul scriptului: "#define DIALOG_GPS 2" (In loc de 2 pui un numar oarecare, insa...sa te asiguri ca numarul respectiv nu este folosit deja de un alt dialog), sau poti creea un enum, tot in header.

enum {
DIALOG_GPS
};
 

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

Link to comment
Share on other sites

C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(3300) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(3328) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(3364) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(3365) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(3392) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4507) : error 004: function "IsPlayerInZone" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4512) : error 004: function "IsPlayerInZone" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4517) : error 004: function "IsPlayerInZone" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4522) : error 004: function "IsPlayerInZone" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4527) : error 004: function "IsPlayerInZone" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4532) : error 004: function "IsPlayerInZone" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4595) : error 004: function "ResetPlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(4646) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(5219) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(5530) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(5531) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(5675) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6044) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6062) : error 004: function "GetPlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6112) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6143) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6144) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6190) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6191) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6241) : error 004: function "GivePlayerCash" is not implemented
C:UsersJorjDesktoppro-gaminggpro-gamingggamemodesPG.pwn(6242) : error 004: function "GivePlayerCash" is not implemented
 
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
 
 
26 Errors.
 
 
erorrrrrrrrrrrrrrriiiiiiiii
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.