[Pedido] gps
#1

ae gente procurei hoje a tarde toda nao achei queria perguntar se alguem tem um sistema de gps que e asim
o player digita /gps [ID] ai seta um checpoint no player do id digitado e aparece no map um ponto vermelho de onde o player ta e um text da longitura do player se alguem solber da uma ajuda aki se alguem saber fazer e poder me ajudar agradeзo!
Reply
#2

vocк usa zcmd+sscanf ou strcmp?

edit:
aqui tem um em zcmd:
pawn Код:
CMD:gps(playerid, params[]) {
    new sendid;
    if (sscanf(params, "u", sendid)) return SendClientMessage(playerid, lightgray, "USO: /gps [id]");
   
    if (!IsPlayerConnected(sendid)) return SendClientMessage(playerid, lightgray, "O Player indicado estб offline");
   
    new Float:x, Float:y, Float:z;
    GetPlayerPos(sendid, x, y, z);
   
    SetPlayerCheckpoint(playerid, x, y, z, 10.0);
    SendClientMessage(playerid, green, "Siga o checkpoint para achar o player.");
    return 1;
}
Reply
#3

PHP код:
/******************************************************************************
 *                                                                            *
 * Copyright © Fуrum SA-MP                                                  *
 *                                                                            *
 ******************************************************************************/
#include <a_samp>
#define FILTERSCRIPT
#include <zcmd>
#include <sscanf2>
public OnPlayerEnterCheckpoint(playerid)
{
    
SendClientMessage(playerid, -1"Vocк chegou em seu destino! (/gps)");
    
DisablePlayerCheckpoint(playerid);
    return 
1;
}
stock Nome(playerid)
{
    new 
Name[MAX_PLAYERS];
    
GetPlayerName(playeridNamesizeof(Name));
    return 
Name;
}
    
CMD:gps(playeridparams[])
    {
        new 
String[128], IDFloat:XFloat:YFloat:Z;
        
GetPlayerPos(IDXYZ);
        if(
sscanf(params"u"ID)) return SendClientMessage(playerid, -1"Digite: /gps <id>");
        if(!
IsPlayerConnected(ID)) return SendClientMessage(playerid, -1"[ERRO] Jogador nгo conectado!");
        
format(Stringsizeof(String), "Foi marcado um checkpoint no jogador: (%d) %s"IDNome(ID));
        
SendClientMessage(playerid, -1String);
        
SetPlayerCheckpoint(playeridXYZ5.0);
        return 
1;
    } 
Reply
#4

leandro meu gm so ta pegando strcmp se poder mandar em strcmp agradeзo!
Reply
#5

Por que nгo usa como FILTERSCRIPT entгo?
Reply
#6

pq da dando comflito tbm mesmo que seja como fs!
Reply
#7

pawn Код:
if(strcmp(cmd, "/gps", true) == 0)
{
    new tmp[128];
    tmp = strtok(cmdtext, idx);

    if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USO: /gps [id]");

    new Float:x, Float:y, Float:z;
    GetPlayerPos(strval(tmp), x, y, z);

    SetPlayerCheckpoint(playerid, x, y, z, 10.0);
    SendClientMessage(playerid, green, "Siga o checkpoint para achar o player.");
    return 1;
}
aqui, tenta ai, nгo sou muito bom com strtok
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)