SA-MP Forums Archive
How to add Locator - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to add Locator (/showthread.php?tid=148958)



How to add Locator - firedrumer03 - 19.05.2010

hey i have a /call 911 system but i was wondering if someone could help me add to it so that when someone uses it and the dispatch gives it to the officers that a locator shows where the person called from?


Re: How to add Locator - ViruZZzZ_ChiLLL - 19.05.2010

Quote:

/call 911 [reason]

and then, it will send as a client message to all, to the
police officers, saying :

ViruZZzZ_ChiLLL needs help [stating the reason here], at Grove Street!

like that?


Re: How to add Locator - firedrumer03 - 19.05.2010

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:

/call 911 [reason]

and then, it will send as a client message to all, to the
police officers, saying :

ViruZZzZ_ChiLLL needs help [stating the reason here], at Grove Street!

like that?
not quite, i want it to add a marker on the map so cops and medics can see it


Re: How to add Locator - ViruZZzZ_ChiLLL - 19.05.2010

Quote:
Originally Posted by firedrumer03
Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:

/call 911 [reason]

and then, it will send as a client message to all, to the
police officers, saying :

ViruZZzZ_ChiLLL needs help [stating the reason here], at Grove Street!

like that?
not quite, i want it to add a marker on the map so cops and medics can see it
Nope, sorry, can't help you with that

This is my thought on it though :

On player command, the map icon must show to any police officers
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
{
SetPlayerMapIcon(playerid, 1, x, y, z, 41, 1);
}
Then when the player is now safe or anything

/done or sumthing
pawn Код:
RemovePlayerMapIcon(playerid, 1);
The map icon id 41 is the


Re: How to add Locator - coole210 - 19.05.2010

O.o just do this at top of script

Код:
new Float:calleridXYZ[3];
then in command for /call 911 add:

Код:
GetPlayerPos(playerid,calleridXYZ[0],calleridXYZ[1],calleridXYZ[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i == cop) //just example
{
SetPlayerCheckpoint(i,calleridXYZ[0],calleridXYZ[1],calleridXYZ[2],3);
}
}



Re: How to add Locator - firedrumer03 - 19.05.2010

Quote:
Originally Posted by Coole210
O.o just do this at top of script

Код:
new Float:calleridXYZ[3];
then in command for /call 911 add:

Код:
GetPlayerPos(playerid,calleridXYZ[0],calleridXYZ[1],calleridXYZ[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i == cop) //just example
{
SetPlayerCheckpoint(i,calleridXYZ[0],calleridXYZ[1],calleridXYZ[2],3);
}
}
This is what im looking for i'll try it out thanx


Re: How to add Locator - firedrumer03 - 19.05.2010

Quote:
Originally Posted by Coole210
O.o just do this at top of script

Код:
new Float:calleridXYZ[3];
then in command for /call 911 add:

Код:
GetPlayerPos(playerid,calleridXYZ[0],calleridXYZ[1],calleridXYZ[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i == cop) //just example
{
SetPlayerCheckpoint(i,calleridXYZ[0],calleridXYZ[1],calleridXYZ[2],3);
}
}
ok i got it to work with my script but when an officer enters it i doesn't clear, how to fix that or way to set a timer on it?


Re: How to add Locator - BLAbla93 - 20.05.2010

on checkpoint enter clear it



Re: How to add Locator - firedrumer03 - 20.05.2010

ok i got that part working now im try to modify it for the /backup command for the police and i can get it to set and to clear when someone enters, but how can i get it to clear when the person that used /backup uses /backupclear?

Sorry for all the questions about this but im semi new to scripting and this is my first time scripting a locator like this, i really appreciate all the help.


Re: How to add Locator - BLAbla93 - 20.05.2010

use
Код:
DisablePlayerCheckpoint(playerid);
to disable a checkpoint for a specific player!