/gps <playerid> - HELP!
#1

I`m trying to make that when a player types /gps <other player`s id> on the player who wrote that command, he can see a marker that shows where the other player is. And after 1 real life minute the tracking stops.
Reply
#2

and...
what is your problem?
Reply
#3

I don`t know how to do it.
Reply
#4

Just get the cords and use SetPlayerCheckpoint?
Reply
#5

can you give me the code for /gps and the playercheckpoint?
Reply
#6

Quote:
Originally Posted by nickbugun
can you give me the code for /gps and the playercheckpoint?
Use the Wiki (www.wiki.sa-mp.com) to do it yourself.
You will need to lookup GetPlayerPos & SetPlayerCheckpoint.
Reply
#7

you all are wrong..

use:
SetPlayerMarkerForPlayer();

https://sampwiki.blast.hk/index.php/SetP...arkerForPlayer

Luxeon
Reply
#8

But I don`t know how to write the /gps <playerid> code :/
Reply
#9

Hi.
Код:
#include <a_samp>
forward timer();
#if defined FILTERSCRIPT
#define FILTERSCRIPT
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256], tmp[256], string[256], idx, giveplayerid;
	if(strcmp(cmd, "/gps", true) == 0)
	{
	  new Float:x, Float:y, Float:z;
	  GetPlayerPos(giveplayerid, x, y, z);
 		tmp = strtok(cmdtext, idx);
	  if(!strlen(tmp))
		{
			SendClientMessage(playerid,0xFFFF00AA,"Usage: /gps [playerid]");
		 	return 1;
		}
		giveplayerid = ReturnUser(tmp);
		if(IsPlayerConnected(giveplayerid))
		{
		new Name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, Name, sizeof(Name));
		format(string, sizeof(string), "%s %s launched in the wake of GPS to find you!'", Name);
		SendClientMessage(giveplayerid, 0xFFFF00AA, string);
		SendClientMessage(playerid, 0xFFFF00AA, "Coords : %f,%f,%f, Checkpoint created!Go to player!");
		SetTimer("message",1000,false);
		SetPlayerCheckpoint(playerid, x, y, z);
		} else SendClientMessage(playerid, 0xFFFF00AA, "Player is not connected.");
		return 1;
	}
	return 0;
}
public timer()
{
	new giveplayerid;
  new Float:x, Float:y, Float:z;
  GetPlayerPos(giveplayerid, x, y, z);
  SetPlayerCheckpoint(playerid, x, y, z);
	return 1;
}
#endif
Reply
#10

Quote:
Originally Posted by The Modder
Hi.
Код:
if(strcmp(cmd, "/gps", true) == 0)
	{
tmp = strtok(cmdtext, idx);
		  if(!strlen(tmp))
			{
					SendClientMessage(playerid,SZURKE,"Hasznбlat: /katona [playerid]");
					return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			  Info[playerid][lmunka] = 12;
			  GivePlayerWeapon(giveplayerid, 24, 500);
			  GivePlayerWeapon(giveplayerid, 31, 700);
			  GivePlayerWeapon(giveplayerid, 3, 500);
			  new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof (name));
				format(string, sizeof(string), "%s, a tбbornok Kцzlegйnnyй nevezett ki.Mostantуl a seregnйl szolgбlsz.", name);
				SendClientMessage(giveplayerid, CITROM, string);
				GetPlayerName(giveplayerid, giveplayer, sizeof (giveplayer));
				format(string, sizeof(string), "Kinevezted %s-t kцzlegйnnyй!", giveplayer);
				SendClientMessage(playerid, CITROM, string);
				SetPlayerSkin(giveplayerid, 285);
			} else SendClientMessage(playerid, SZURKE, "Jбtйkos nem elйrhető.");
		} else SendClientMessage(playerid, SZURKE, "Nem vagy leader.");
		return 1;
	}
Copying codes is very easy.

pawn Код:
new
  cmd[128];
cmd=strtok(cmdtext,idx);
if(!strcmp(cmd,"/gps",true))
{
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,color,"/gps [playerid/name]");
  new id=ReturnUser(cmd);
  if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color,"That player not connected.");
  SetPlayerMarkerForPlayer(playerid,id,color);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)