[AJUDA] alguem me ajuda a melhorar o procurar
#1

bem alguem poderia me ajudar a melhorar meu /procurar, pois ele so da a posiзгo do player uma vez, tipo ele nao mostra o player em movimento, vc tenke ficar o tempo todo usando o /procurar , eu ate tentei mas nao conseguir, meu comando e esse, alguem me ajuda por favor.

Код:
    if(strcmp(cmd, "/procurar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(PlayerInfo[playerid][pEmprego] != 1)
		    {
				SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й Detetive !");
				return 1;
		    }
		    if(PlayerOnMission[playerid] > 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "   Vocк estб em uma missгo, nгo pode usar este comando !");
			    return 1;
			}
			if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Vocк sу pode procurar novamente, daqui a 2 Minutos !");
			    return 1;
			}
		    tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /procurar [ id ]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode se procurar!"); return 1; }
			        new points;
			        new level = PlayerInfo[playerid][pDetSkill];
					if(level >= 0 && level <= 50)
					{ points = 4; }
					else if(level >= 51 && level <= 100)
					{ points = 6; }
					else if(level >= 101 && level <= 200)
					{ points = 8; }
					else if(level >= 201 && level <= 400)
					{ points = 10; }
					else if(level >= 401)
					{ points = 60; }
				    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(giveplayerid, X,Y,Z);
					SetPlayerCheckpoint(playerid, X,Y,Z, 6);
					FindTime[playerid] = 1;
					FindTimePoints[playerid] = points;
					PlayerInfo[playerid][pDetSkill] ++;
					UsedFind[playerid] = 1;
					if(PlayerInfo[playerid][pDetSkill] == 50)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 2, Vocк pode procurar mais rapido e encontrar mais rapido."); }
					else if(PlayerInfo[playerid][pDetSkill] == 100)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 3, Vocк pode procurar mais rapido e encontrar mais rapido."); }
					else if(PlayerInfo[playerid][pDetSkill] == 200)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 4, Vocк pode procurar mais rapido e encontrar mais rapido."); }
					else if(PlayerInfo[playerid][pDetSkill] == 400)
					{ SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 5, Vocк pode procurar mais rapido e encontrar mais rapido."); }
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Invalido NICK/ID !");
			}
		}
	    return 1;
	}
Reply
#2

Isto deve resolver o seu problema

Coloque :

pawn Код:
//No OnPlayerCommandText:

if(strcmp(cmd, "/procurar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pEmprego] != 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й Detetive !");
                return 1;
            }
            if(PlayerOnMission[playerid] > 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк estб em uma missгo, nгo pode usar este comando !");
                return 1;
            }
            if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк sу pode procurar novamente, daqui a 2 Minutos !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /procurar [ id ]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode se procurar!"); return 1; }
                    new points;
                    new level = PlayerInfo[playerid][pDetSkill];
                    if(level >= 0 && level <= 50)
                    { points = 4; }
                    else if(level >= 51 && level <= 100)
                    { points = 6; }
                    else if(level >= 101 && level <= 200)
                    { points = 8; }
                    else if(level >= 201 && level <= 400)
                    { points = 10; }
                    else if(level >= 401)
                    { points = 60; }
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    new TimerProcura = SetTimerEx("GivePlayerIDCheckpoint", 1000, true, "di", playerid, giveplayerid);
                    SetPVarInt(playerid,"TimerProcura",TimerProcura);
                    FindTime[playerid] = 1;
                    FindTimePoints[playerid] = points;
                    PlayerInfo[playerid][pDetSkill] ++;
                    UsedFind[playerid] = 1;
                    if(PlayerInfo[playerid][pDetSkill] == 50)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 2, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 100)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 3, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 200)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 4, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 400)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 5, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Invalido NICK/ID !");
            }
        }
        return 1;
    }


//No OnPlayerEnterCheckpoint:


if(IsPlayerInRangeOfPoint(playerid,3.0,GetPVarFloat(playerid,"FocoX"), GetPVarFloat(playerid,"FocoY"), GetPVarFloat(playerid,"FocoZ")))
    {
        DisablePlayerCheckpoint(playerid);
        DeletePVar(playerid,"FocoX");
        DeletePVar(playerid,"FocoY");
        DeletePVar(playerid,"FocoZ");
        KillTimer(GetPVarInt(playerid,"TimerProcura"));
    }






//No Final do GM:


forward GivePlayerIDCheckpoint(playerid, giveplayerid);
public GivePlayerIDCheckpoint(playerid, giveplayerid)
{
    DisablePlayerCheckpoint(playerid);
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPVarFloat(playerid,"FocoX",X);
    SetPVarFloat(playerid,"FocoY",Y);
    SetPVarFloat(playerid,"FocoZ",Z);
    SetPlayerCheckpoint(playerid, X,Y,Z, 6);
    return 1;
}

Espero ter ajudado
Reply
#3

pow brigadao aew, vo testa jaja eu edito.

---------------------------------------------

Pow valeuzao funfo, agora por favor alguem pode me ajudar com esse problema aki
Reply
#4

parece que o sistema que o rjjj postou vai funcionar, Se nao funfar fala ai que a gente te ajuda
Reply
#5

RJJ deu um problema veiu quando vc xega na marca ela nao some,nem mesmo quando o tempo acaba, uq eu fasso? e quando vc da procurar em outra pessoa ele fica alternando indo na pessoa antiga e na nova.
Reply
#6

Pronto, arrumei o cуdigo, apesar de nгo ter visto nada que pudesse causar esse bug

Aqui estб, se nгo ficar do jeito que vocк quer ainda, espere outro membro do fуrum pra ajudб-lo, ou aprenda a mecher no sistema de /procurar do seu Thug

pawn Код:
//No OnPlayerCommandText:

if(strcmp(cmd, "/procurar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pEmprego] != 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й Detetive !");
                return 1;
            }
            if(PlayerOnMission[playerid] > 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк estб em uma missгo, nгo pode usar este comando !");
                return 1;
            }
            if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк sу pode procurar novamente, daqui a 2 Minutos !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /procurar [ id ]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode se procurar!"); return 1; }
                    new points;
                    new level = PlayerInfo[playerid][pDetSkill];
                    if(level >= 0 && level <= 50)
                    { points = 4; }
                    else if(level >= 51 && level <= 100)
                    { points = 6; }
                    else if(level >= 101 && level <= 200)
                    { points = 8; }
                    else if(level >= 201 && level <= 400)
                    { points = 10; }
                    else if(level >= 401)
                    { points = 60; }
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    KillTimer(GetPVarInt(playerid,"TimerProcura"));
                    DisablePlayerCheckpoint(playerid);
                    DeletePVar(playerid,"TimerProcura");
                    new TimerProcura;
                    TimerProcura = SetTimerEx("GivePlayerIDCheckpoint", 1000, true, "di", playerid, giveplayerid);
                    SetPVarInt(playerid,"TimerProcura",TimerProcura);
                    FindTime[playerid] = 1;
                    FindTimePoints[playerid] = points;
                    PlayerInfo[playerid][pDetSkill] ++;
                    UsedFind[playerid] = 1;
                    if(PlayerInfo[playerid][pDetSkill] == 50)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 2, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 100)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 3, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 200)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 4, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 400)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 5, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Invalido NICK/ID !");
            }
        }
        return 1;
    }




//No OnPlayerEnterCheckpoint:


if(IsPlayerInRangeOfPoint(playerid,10.0,GetPVarFloat(playerid,"FocoX"), GetPVarFloat(playerid,"FocoY"), GetPVarFloat(playerid,"FocoZ")))
    {
        DisablePlayerCheckpoint(playerid);
        DeletePVar(playerid,"FocoX");
        DeletePVar(playerid,"FocoY");
        DeletePVar(playerid,"FocoZ");
        KillTimer(GetPVarInt(playerid,"TimerProcura"));
    }






//No Final do GM:


forward GivePlayerIDCheckpoint(playerid, giveplayerid);
public GivePlayerIDCheckpoint(playerid, giveplayerid)
{
    DisablePlayerCheckpoint(playerid);
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(giveplayerid, X,Y,Z);
    DeletePVar(playerid,"FocoX");
    DeletePVar(playerid,"FocoY");
    DeletePVar(playerid,"FocoZ");
    SetPVarFloat(playerid,"FocoX",X);
    SetPVarFloat(playerid,"FocoY",Y);
    SetPVarFloat(playerid,"FocoZ",Z);
    SetPlayerCheckpoint(playerid, X,Y,Z, 6);
    return 1;
}

Espero ter ajudado
Reply
#7

pow brigadao
Reply
#8

Como vcs aprende a arruma esses negocios?Deve ser dificil pra caraio.
Reply
#9

Quote:
Originally Posted by Didizika_157
Посмотреть сообщение
Como vcs aprende a arruma esses negocios?Deve ser dificil pra caraio.
Acho que todo mundo comeзou a aprender do mesmo video.

Reply
#10

puts valew ae rjjj tava com o msm problema arrumo certinho! rep + pra vc rs
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)