/locate Player for PD
#1

Hi guys, i realy dont have idea how to create /locate command for PD
(Makes posibilty to Police can locate player, set marker on last players location so he can easly find him) if someone have part of code for /locate for police i will be grateful, thanks to all in advance
Reply
#2

PHP код:
#include <a_samp>
#include sscanf
#include zcmd
new Float:CorX,Float:CorY,Float:CorZ;
new 
bool:GPS[MAX_PLAYERS];
new 
pname[MAX_PLAYER_NAME];
forward AtualizeLocal(playerid);
TimerAtualize[MAX_PLAYERS];
new 
str[60];
CMD:locate(playeridparams[])
{
        new 
id;
        if(
GPS[playerid]== true)
        {
            
DisablePlayerCheckpoint(playerid);
            
KillTimer(TimerAtualize[playerid]);
            
GPS[playerid]=false;
        }
        
//variable PD
        
if(sscanf(params"u"id))return SendClientMessage(playerid,-1,"/locate [id]");
        if(!
IsPlayerConnected(id))return SendClientMessage(playerid,-1,"ERROR! player off.");
        
GetPlayerPos(idCorXCorYCorZ);
        
SetPlayerCheckpoint(playeridCorXCorY, -570.01.0);
        
GetPlayerName(idpname23);
        
format(strsizeof(str), "[PD]: You found player %s[%d]!"pnameid);
        
SendClientMessage(playerid,-1,str);
              
TimerAtualize[id] = SetTimerEx("AtualizeLocal"1000true"i"playerid);
        
GPS[playerid]=true;
        return 
1;
}
public 
AtualizeLocal(playerid)
{
    
DisablePlayerCheckpoint(playerid);
       
GetPlayerPos(playeridCorXCorYCorZ);
    
SetPlayerCheckpoint(playeridCorXCorY, -570.00.0);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)