[Ajuda] Problema com sscanf
#3

Cara muito obrigado, deu certinho, o code ficou assim:
pawn Код:
YCMD:gps(playerid, params[], help)
{
    new gp[12];
   
    if( help ) return SendClientMessage(playerid, -1, "Este comando o ajuda a localizar um player no mapa.");
    if( sscanf( params, "s[11]", gp) ) return SendClientMessage(playerid, -1, "Uso: /gps (ID / off)]");
    if(strcmp(gp, "off", true) == 0)
    {
        if(HaveGPS[playerid]) {
            KillTimer(GPSTimer[playerid]);
            HaveGPS[playerid] = false;
            GPSTimer[playerid] = 0;
            DisablePlayerCheckpoint(playerid);
            SendClientMessage(playerid, 0xFFFF00AA, "GPS: Desligado.");
        }else SendClientMessage(playerid, 0xFF0000AA, "GPS: Seu GPS estб desligado !");
        return 1;
    }
    if(IsPlayerConnected(strval(gp))) {
        if(strval(gp) != playerid) {
            if(HaveGPS[playerid]) {
                KillTimer(GPSTimer[playerid]);
                HaveGPS[playerid] = false;
                GPSTimer[playerid] = 0;
            }
            GPSTimer[playerid] = SetTimerEx("GPSUpdate", 500, true, "dd", playerid,strval(gp));
            HaveGPS[playerid] = true;
            new str[128],nick[24];
            GetPlayerName(strval(gp),nick,24);
            format(str,128,"GPS: Ligado, alvo: %s (ID: %d)",nick,strval(gp));
            SendClientMessage(playerid, 0xFFFF00AA, str);
        }else SendClientMessage(playerid, 0xFF0000AA, "GPS: Use corretamente o seu GPS !");
    }else SendClientMessage(playerid, 0xFF0000AA, "GPS: Alvo nгo encontrado(ID errado) !");
    return 1;
}
Quote:

rep++

Reply


Messages In This Thread
Problema com sscanf - by JackStenzel - 03.12.2014, 22:44
Re: Problema com sscanf - by MultiKill - 03.12.2014, 22:55
Re: Problema com sscanf - by JackStenzel - 03.12.2014, 23:17
Re: Problema com sscanf - by PT - 03.12.2014, 23:26
Re: Problema com sscanf - by JackStenzel - 03.12.2014, 23:33

Forum Jump:


Users browsing this thread: 2 Guest(s)