[Pedido] Comando /localizar
#1

Fala galera, na minha gm jб possui um comando, porйm ele nгo marca no mini mapa com o checkpoint vermelho, simplesmente fala o nome do local que o player esteve recentemente, gostaria se possнvel um comando onde marcasse no mapa e tambйm "perseguisse" por alguns minutos e que sу funcionasse com players com estrelas, obrigado desde jб, preciso em Zcmd.

Pra nгo criar outro post, tenho uma dъvida, como posso fazer que os players apareзam no mini mapa ? atй aparece aqui porйm as cores sгo fracas quase transparente, gostaria que ficasse bem marcado no mini mapa
Reply
#2

PHP код:
CMD:localizar(playeridparams[])
{
    new 
id,string[90], FloatPos[3];
    if(
sscanf(params), "d"id) return 1;
    if(!
IsPlayerConnected(id)) return 1;
    
format(stringsizeof(string), "Vocк localizou ID:%d",id);
    
GetPlayerPos(idPos[0], Pos[1], Pos[2]);
    
SetPlayerCheckpoint(playeridPos[0], Pos[1], Pos[2], 3.0);
    return 
SendClientMessage(playerid,-1string);

Se quiser que fique atualizando, crie um timer.
Reply
#3

Quote:
Originally Posted by IlanZ
Посмотреть сообщение
PHP код:
CMD:localizar(playeridparams[])
{
    new 
id,string[90], FloatPos[3];
    if(
sscanf(params), "d"id) return 1;
    if(!
IsPlayerConnected(id)) return 1;
    
format(stringsizeof(string), "Vocк localizou ID:%d",id);
    
GetPlayerPos(idPos[0], Pos[1], Pos[2]);
    
SetPlayerCheckpoint(playeridPos[0], Pos[1], Pos[2], 3.0);
    return 
SendClientMessage(playerid,-1string);

Se quiser que fique atualizando, crie um timer.
Poderia me ajudar a criar esse timer ?
Reply
#4

Tente assim, fiz isso no meio de uma partida de jogo :c

PHP код:
new Timer[MAX_PLAYERS];
new 
Float:Pos[3];

public 
OnPlayerEnterCheckpoint(playerid)
{
    
DisablePlayerCheckpoint(playerid);
    
SendClientMessage(playerid, -1"Vocк chegou ate ele");
    return 
1;
}

CMD:localizar(playeridparams[])
{
    new 
id,string[90];
    if(
sscanf(params), "d"id) return 1;
    if(!
IsPlayerConnected(id)) return 1;
    
format(stringsizeof(string), "Vocк localizou ID:%d",id);
    
GetPlayerPos(idPos[0], Pos[1], Pos[2]);
    
SetPlayerCheckpoint(playeridPos[0], Pos[1], Pos[2], 3.0);
    
Timer[playerid] = SetTimerEx("LocalizarP1"1500true"i"id);
    
SetPVarFloat(playerid,"xpos",Pos[0]), SetPVarFloat(playerid,"ypos",Pos[1]), SetPVarFloat(playerid,"zpos",Pos[2]);
    
SendClientMessage(playerid,-1string);
    return 
1
}

forward LocalizarP1(playerid);
public 
LocalizarP1(playerid)
{
    
SetTimerEx("LocalizarP2"100false"i"playerid);
    return 
1;
}
forward LocalizarP2(playerid);
public 
LocalizarP2(playerid)
{
    
SetPlayerCheckpoint(playeridGetPVarFloat(playerid,"xpos"), GetPVarFloat(playerid,"ypos"), GetPVarFloat(playerid,"zpos"), 3.0);
    return 
1;

Reply
#5

mas para ficar aparecendo no mapa sem que seja com um checkpoint, que fique sу no radar creio que se usa:

SetPlayerMarkerForPlayer
Reply
#6

Quote:
Originally Posted by Scorpion659
Посмотреть сообщение
mas para ficar aparecendo no mapa sem que seja com um checkpoint, que fique sу no radar creio que se usa:

SetPlayerMarkerForPlayer
https://sampwiki.blast.hk/wiki/ShowPlayerMarkers
Reply
#7

PHP код:
new
    
timerCP[MAX_PLAYERS],
    
boolLocalizando[MAX_PLAYERS];
    
public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(timerCP[playerid]);
    return 
true;
}
CMD:localizar(playeridparams[])
{
    if(
sscanf(params"s[10]"params))
        return 
SendClientMessage(playerid, -1"/localizar <id/desligar>");
    if(!
strcmp(params"desligar"))
    {
        
KillTimer(timerCP[playerid]);
        
Localizando[playerid] = false;
        
DisablePlayerCheckpoint(playerid);
    }
    else {
        static 
id_player;
        
id_player strval(params);
    
        if(!
IsPlayerConnected(id_player) || playerid == id_player)
            return 
SendClientMessage(playerid, -1"ID Invбlido");
            
        if(
Localizando[playerid])
            return 
SendClientMessage(playerid, -1"Vocк jб estб localizando alguйm. Digite: /localizar desligar");
    
        
Localizando[playerid] = true;
        
timerCP[playerid] = SetTimerEx("AtualizarCP"1000true"ii"playeridid_player);
    }
    return 
true;
}
AtualizarCP(playeridid_player);
public 
AtualizarCP(playeridid_player)
{
    if(!
IsPlayerConnected(id_player))
    {
        
KillTimer(timerCP[playerid]);
        
Localizando[playerid] = false;
        
DisablePlayerCheckpoint(playerid);
        return 
false;
    }
    static 
FloatposxFloatposyFloatposz;
    
GetPlayerPos(id_playerposxposyposz);
    
SetPlayerCheckpoint(playeridposxposyposz5.0);
    return 
true;

Reply
#8

Quote:
Originally Posted by AuhMaru
Посмотреть сообщение
PHP код:
new
    
timerCP[MAX_PLAYERS],
    
boolLocalizando[MAX_PLAYERS];
    
public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(timerCP[playerid]);
    return 
true;
}
CMD:localizar(playeridparams[])
{
    if(
sscanf(params"s[10]"params))
        return 
SendClientMessage(playerid, -1"/localizar <id/desligar>");
    if(!
strcmp(params"desligar"))
    {
        
KillTimer(timerCP[playerid]);
        
Localizando[playerid] = false;
        
DisablePlayerCheckpoint(playerid);
    }
    else {
        static 
id_player;
        
id_player strval(params);
    
        if(!
IsPlayerConnected(id_player) || playerid == id_player)
            return 
SendClientMessage(playerid, -1"ID Invбlido");
            
        if(
Localizando[playerid])
            return 
SendClientMessage(playerid, -1"Vocк jб estб localizando alguйm. Digite: /localizar desligar");
    
        
Localizando[playerid] = true;
        
timerCP[playerid] = SetTimerEx("AtualizarCP"1000true"ii"playeridid_player);
    }
    return 
true;
}
AtualizarCP(playeridid_player);
public 
AtualizarCP(playeridid_player)
{
    if(!
IsPlayerConnected(id_player))
    {
        
KillTimer(timerCP[playerid]);
        
Localizando[playerid] = false;
        
DisablePlayerCheckpoint(playerid);
        return 
false;
    }
    static 
FloatposxFloatposyFloatposz;
    
GetPlayerPos(id_playerposxposyposz);
    
SetPlayerCheckpoint(playeridposxposyposz5.0);
    return 
true;

Nгo resultou, quando inserimos algum id ele da id invбlido
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)