05.04.2012, 17:08
Procurei mais sу achei em Strmp, alguйm tem um bom comando ou sistema de procurar player aн ? (em ZCMD)!
CMD:procurar(playerid,params[]) {
new id, Float:f[3];
if(sscanf(params, "i", id))
return SendClientMessage(playerid, -1, "/procurar [ID]");
if(!IsPlayerConnected(id))
return false;
GetPlayerPos(id, f[0], f[1], f[2]);
SetPlayerCheckPoint(playerid, f[0], f[1], f[2], 5);
return true;
}
#define BRANCO 0xFFFFFFFF
new TempoProcurar[500];
forward ProcurarTempo(playerid,give);
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
DisablePlayerCheckpoint(playerid);
KillTimer(TempoProcurar[playerid]);
CMD:procurar(playerid, params[])
{
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, BRANCO,"Use: /procurar");
if(ID == playerid) { SendClientMessage(playerid, BRANCO, "Vocк nгo pode se procurar!"); return true; }
DisablePlayerCheckpoint(playerid);
KillTimer(TempoProcurar[playerid]);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(ID, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
GameTextForPlayer(playerid, "~r~Va ate a marca vermelha!", 2500, 1);
TempoProcurar[playerid] = SetTimerEx("ProcurarTempo",1000,true,"ii",playerid,ID);
return 1;
}
public ProcurarTempo(playerid,give)
{
if(!IsPlayerConnected(give))
{
KillTimer(TempoProcurar[playerid]);
DisablePlayerCheckpoint(playerid);
return SendClientMessage(playerid, BRANCO, "O filho da puta que estava sendo procurado saiu do servidor.");
}
static Float:X,Float:Y,Float:Z;
GetPlayerPos(give,X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 5);
if(PlayerToPoint(6.0,playerid,X,Y,Z))
{
DisablePlayerCheckpoint(playerid);
KillTimer(TempoProcurar[playerid]);
GameTextForPlayer(playerid, " ~w~Voce chegou ao ~b~FDP", 5000, 3);
}
return true;
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return true;
}
}
return false;
}
Olб galerinha, eu sou novato em script, mais fiz um script que talvez seja ъtil para vocк, aqui comigo deu certo,
tenta esse ae: Topo do Gamemode: PHP код:
PHP код:
PHP код:
|
public ProcurarTempo(playerid,give)
{
if(!IsPlayerConnected(give))
{
KillTimer(TempoProcurar[playerid]);
DisablePlayerCheckpoint(playerid);
return SendClientMessage(playerid, BRANCO, "O filho da puta que estava sendo procurado saiu do servidor.");
}
static Float:X,Float:Y,Float:Z;
GetPlayerPos(give,X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 5);
if(IsPlayerRangeOfPoint(playerid,6.0,X,Y,Z))
{
DisablePlayerCheckpoint(playerid);
KillTimer(TempoProcurar[playerid]);
GameTextForPlayer(playerid, " ~w~Voce chegou ao ~b~FDP", 5000, 3);
}
return true;
}