03.12.2014, 23:17
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++ |