Timer GPS
#1

salut, cum as putea face un timer la gps sa se poata folosi odata la 5 minute?
Code:
#include <a_samp>

#pragma tabsize 0

#define COLOR_GREEN 0x33AA33AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xFF3366FF

#define Filterscript
#if defined Filterscript

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" GPS by Jofi");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" GPS by Jofi");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
		if (strcmp(cmdtext, "/gps", true)==0)
		{
				if(IsPlayerConnected(playerid))
		{
				SendClientMessage(playerid, COLOR_RED, "-----------------------------------------------------------------------------------------");
				SendClientMessage(playerid, COLOR_GREEN, "/gps [locatie] /gps2 (pagina urmatoare)");
				SendClientMessage(playerid, COLOR_GREEN, "/oprestegps (Sterge Checkpointul de pe harta)");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: CartierProGaming, Mall Banca, 24/7, Primarie");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: Licente, GunShop, Ferma, CarPaint, Politie");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: Pizza, Binco, PigPen, Alhambra, S.R.I., Aeroport");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: BurgerShot, Benzinarie, Benzinarie2, Benzinarie3,");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: MasiniPersonale, VanzareMasini, Spital, FermaTractorist");
				SendClientMessage(playerid, COLOR_RED, "-----------------------------------------------------------------------------------------");
			}
   }
   		if (strcmp(cmdtext, "/gps2", true)==0)
		{
				if(IsPlayerConnected(playerid))
		{
				SendClientMessage(playerid, COLOR_RED, "----------------------------------------------------------------------------------------");
				SendClientMessage(playerid, COLOR_GREEN, "/gps [locatie]");
				SendClientMessage(playerid, COLOR_GREEN, "/oprestegps (Sterge Checkpointul de pe harta)");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: GroveStreet, Jefferson, Rodeo, SantaMaria, VeronaBeach");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: Marina, Mulholland, Richman, FlintCounty, EastBeach");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: LosFlores, ElCorona, Ganton, Mall, Vinewood");
				SendClientMessage(playerid, COLOR_ORANGE, "Locatie: Dillimore, Blueberry, Montgomery, PalominoCreek");
				SendClientMessage(playerid, COLOR_RED, "----------------------------------------------------------------------------------------");
			}
   }


                if(IsPlayerConnected(playerid))
                
				if (strcmp(cmdtext, "/gps Licente", true)==0)
				SetPlayerCheckpoint(playerid,2053.2761,-1909.5160,13.5469,5);
				
				if (strcmp(cmdtext, "/gps Banca", true)==0)
				SetPlayerCheckpoint(playerid,1461.7273,-1023.7429,23.4017,5);

				if (strcmp(cmdtext, "/gps 24/7", true)==0)
				SetPlayerCheckpoint(playerid,1315.3618,-899.8662,39.1489,5);

				if (strcmp(cmdtext, "/gps MasiniPersonale", true)==0)
				SetPlayerCheckpoint(playerid,847.510620,-2128.946044,12.370815,5);

				if (strcmp(cmdtext, "/gps VanzareMasini", true)==0)
				SetPlayerCheckpoint(playerid,1612.653076,-1015.431091,23.475412,5);

				if (strcmp(cmdtext, "/gps CartierProGaming", true)==0)
				SetPlayerCheckpoint(playerid,2865.053710,-1962.187255,11.109375,5);

				if (strcmp(cmdtext, "/gps Aeroport", true)==0)
				SetPlayerCheckpoint(playerid,1599.2776,-2328.4224,13.5366,5);

				if (strcmp(cmdtext, "/gps Primarie", true)==0)
				SetPlayerCheckpoint(playerid,1480.8268,-1744.1536,13.1170,5);

				if (strcmp(cmdtext, "/gps Politie", true)==0)
				SetPlayerCheckpoint(playerid,1544.0143,-1675.6829,13.5576,5);

				if (strcmp(cmdtext, "/gps GroveStreet", true)==0)
				SetPlayerCheckpoint(playerid,2493.8511,-1669.5573,12.9113,5);

				if (strcmp(cmdtext, "/gps Jefferson", true)==0)
				SetPlayerCheckpoint(playerid,2220.9824,-1148.7661,25.3504,5);

				if (strcmp(cmdtext, "/gps Benzinarie", true)==0)
				SetPlayerCheckpoint(playerid,1005.4007,-940.1948,41.7549,5);

				if (strcmp(cmdtext, "/gps Rodeo", true)==0)
				SetPlayerCheckpoint(playerid,347.7415,-1367.7371,13.9776,5);

				if (strcmp(cmdtext, "/SantaMaria -", true)==0)
				SetPlayerCheckpoint(playerid,327.8009,-1797.7816,4.2844,5);

				if (strcmp(cmdtext, "/gps VeronaBeach", true)==0)
				SetPlayerCheckpoint(playerid,831.8949,-1819.0989,11.8452,5);

				if (strcmp(cmdtext, "/gps Marina", true)==0)
				SetPlayerCheckpoint(playerid,728.5689,-1593.4337,13.9832,5);

				if (strcmp(cmdtext, "/gps GunShop", true)==0)
				SetPlayerCheckpoint(playerid,1364.6945,-1279.8040,13.1127,5);

				if (strcmp(cmdtext, "/gps Spital", true)==0)
				SetPlayerCheckpoint(playerid,1183.3936,-1323.9601,13.1430,5);

				if (strcmp(cmdtext, "/gps Mall", true)==0)
				SetPlayerCheckpoint(playerid,1129.145751,-1443.013916,15.796875,5);

				if (strcmp(cmdtext, "/gps Mulholland", true)==0)
				SetPlayerCheckpoint(playerid,1338.9668,-694.6091,91.4037,5);

				if (strcmp(cmdtext, "/gps Richman", true)==0)
				SetPlayerCheckpoint(playerid,675.6179,-1061.0540,48.9433,5);

				if (strcmp(cmdtext, "/gps FlintCounty", true)==0)
				SetPlayerCheckpoint(playerid,-116.5864,-1186.2360,2.2648,5);

				if (strcmp(cmdtext, "/gps Benzinarie2", true)==0)
				SetPlayerCheckpoint(playerid,-116.5864,-1186.2360,2.2648,5);

				if (strcmp(cmdtext, "/gps Ferma", true)==0)
				SetPlayerCheckpoint(playerid,-376.0385,-1440.0708,25.2968,5);

				if (strcmp(cmdtext, "/gps BurgerShot", true)==0)
				SetPlayerCheckpoint(playerid,819.6470,-1619.0469,13.1127,5);

				if (strcmp(cmdtext, "/gps Binco", true)==0)
				SetPlayerCheckpoint(playerid,2245.066406,-1662.401000,15.469003,5);

				if (strcmp(cmdtext, "/gps Pizza", true)==0)
				SetPlayerCheckpoint(playerid,2093.0984,-1807.0825,13.1196,5);

				if (strcmp(cmdtext, "/gps CarPaint", true)==0)
				SetPlayerCheckpoint(playerid,2074.3252,-1830.9292,13.1171,5);

				if (strcmp(cmdtext, "/gps EastBeach", true)==0)
				SetPlayerCheckpoint(playerid,2732.0156,-1662.9469,12.8089,5);

				if (strcmp(cmdtext, "/gps LosFlores", true)==0)
				SetPlayerCheckpoint(playerid,2729.4907,-1258.4280,59.1302,5);

				if (strcmp(cmdtext, "/gps PigPen", true)==0)
				SetPlayerCheckpoint(playerid,2418.3625,-1234.1200,23.9079,5);

				if (strcmp(cmdtext, "/gps Alhambra", true)==0)
				SetPlayerCheckpoint(playerid,1827.9978,-1683.6870,13.1136,5);

				if (strcmp(cmdtext, "/gps FermaTractorist", true)==0)
				SetPlayerCheckpoint(playerid,-37.921279,-1.555945,3.117187,5);

				if (strcmp(cmdtext, "/gps S.R.I.", true)==0)
				SetPlayerCheckpoint(playerid,1534.5702,-1448.2894,12.9553,5);

				if (strcmp(cmdtext, "/gps ElCorona", true)==0)
				SetPlayerCheckpoint(playerid,1822.0739,-2081.0579,12.9534,5);

				if (strcmp(cmdtext, "/gps Ganton", true)==0)
				SetPlayerCheckpoint(playerid,2314.2036,-1742.4119,12.9531,5);

				if (strcmp(cmdtext, "/gps Mall", true)==0)
				SetPlayerCheckpoint(playerid,1129.145751,-1443.013916,15.796875,5);

				if (strcmp(cmdtext, "/gps Vinewood", true)==0)
				SetPlayerCheckpoint(playerid,1103.8586,-941.0670,42.4828,5);

				if (strcmp(cmdtext, "/gps Dillimore", true)==0)
				SetPlayerCheckpoint(playerid,635.8654,-570.4843,15.9069,5);

				if (strcmp(cmdtext, "/gps Benzinarie3", true)==0)
				SetPlayerCheckpoint(playerid,651.2009,-563.4557,15.8840,5);

				if (strcmp(cmdtext, "/gps Blueberry", true)==0)
				SetPlayerCheckpoint(playerid,161.5037,-205.9166,1.1486,5);

				if (strcmp(cmdtext, "/gps Montgomery", true)==0)
				SetPlayerCheckpoint(playerid,1340.4523,257.0470,19.1249,5);

				if (strcmp(cmdtext, "/gps PalominoCreek", true)==0)
				SetPlayerCheckpoint(playerid,2337.7549,43.0897,26.0518,5);

				if(strcmp(cmdtext,"/oprestegps",true)==0)
 	{
		if(IsPlayerConnected(playerid))
		{
				DisablePlayerCheckpoint(playerid);
			}
		}

	return 0;
}
Reply
#2

Daca ai folosi switch(destinatie) ar fi mai usor sa pui conditia, rescrieti comenziile!
Reply
#3

eu vreau sa pun timer deoarece se pot face bani din bug! ex esti farmer si dai /gps spital de "n" ori
Reply
#4

Pai atunci foloseste
Code:
CP[playerid]=6969;
(sau un ID care nu conincide cu checkpointuriile de la fermier)
Reply
#5

Quote:
Originally Posted by cotyzor
View Post
Daca ai folosi switch(destinatie) ar fi mai usor sa pui conditia, rescrieti comenziile!
Nu are cum sa faca asta. Nu poti folosi switch cu stringuri.

Quote:
Originally Posted by cotyzor
View Post
Pai atunci foloseste
Code:
CP[playerid]=6969;
(sau un ID care nu conincide cu checkpointuriile de la fermier)
Oricum se pare ca el foloseste un filterscript pentru GPS, deci n-are cum sa faca nici aia (cel putin nu fara functii din gamemode, folosite prin intermediul CallRemoteFunction).

Quote:
Originally Posted by 3MY
View Post
eu vreau sa pun timer deoarece se pot face bani din bug! ex esti farmer si dai /gps spital de "n" ori
De ce sa pui timer si sa nu rezolvi bugul cu adevarat? In OnPlayerCheckpoint, unde verifici daca jucatorul este fermier verifici si daca jucatorul este unde ar trebui sa fie (ca fermier).
Reply
#6

dar nu stiti cum fac ca sa dispara checkpoint dupa ce am ajuns?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)