[Pedido] Ajuda tempo roubou
#1

queria que aparecese um GameTextForPlayer de contagem de 40 segundos durante o roubo.
comando :
Code:
if(strcmp(cmd,"/roubar",true)==0)
	{
		if(roubando[playerid] == 1)
	    {
	   		SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб roubando algum lugar.");
	    	return 1;
    	}
		if(PlayerToPoint(1.0,playerid, 2306.5127,-6.1166,26.7422))
		{
	    	if(roubobanco == 1)
	    	{
	   			SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma tentativa de roubo nesse cofre.");
	    		return 1;
	    	}
	    	if(temporoubobanco == 1)
	    	{
	   			SendClientMessage(playerid,COLOR_GREY,"Jб roubaram o cofre do banco espere 3 minutos para roubar de novo !");
	    		return 1;
	    	}
			GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
            format(string, sizeof(string), "%s e os %s estгo tentando roubar o cofre banco! ID:[%d]", playername, NomeORG(playerid) , playerid);
			SendClientMessageToAll(GetPlayerColor(playerid), string);
			SendClientMessage(playerid, COLOR_GRAD5, "Espere 40 segundos para terminar de roubar o banco.");
			SetPlayerCriminal(playerid,255, "Tentativa de Roubo ao Banco");
			ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
 			SetTimerEx("AnimRoubo", 500, 0, "i", playerid);
            roubando[playerid] = 1;
            ProvocoBanco[playerid] = 1;
            roubobanco = 1;
            temporoubobanco = 1;
            SetTimer("Aroubo", 220000, 0);
        	tempobanco = SetTimerEx("RouboBanco", 40000, 0, "i", playerid);
        	ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
        	return 1;
		}
public roubobanco
Code:
public RouboBanco(playerid)
{
	KillTimer(tempobanco);
	if(!PlayerToPoint(8.0,playerid,2306.5127,-6.1166,26.7422))
    {
		format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
       	SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        return 1;
    }
	ForPlayers(i)
	{
		new grana = 1000 + random(6000);
		if(PlayerToPoint(10.0,i,2306.5127,-6.1166,26.7422))
		{
		    new var032=0;
			if (PlayerInfo[playerid][pLider] != 0) { var032 = PlayerInfo[playerid][pLider]; }
			else if (PlayerInfo[playerid][pMembro] != 0) { var032 = PlayerInfo[playerid][pMembro]; }
			if(ProvocoBanco[playerid] == 1)
            {
            	format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            	SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            	roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
			}
			if (PlayerInfo[i][pLider] == var032 || PlayerInfo[i][pMembro] == var032)
			{
				SetPlayerCriminal(i,255, "Assalto ao Banco");
				GivePlayerMoney(i, grana);
				format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            	SendClientMessage(i, COLOR_YELLOW, gstring);
			}
		}
	}
	return 1;
}
DAREI REP+
Reply
#2

Quote:
Originally Posted by Pablo_Mantega
View Post
queria que aparecese um GameTextForPlayer de contagem de 40 segundos durante o roubo.
comando :
Code:
if(strcmp(cmd,"/roubar",true)==0)
	{
		if(roubando[playerid] == 1)
	    {
	   		SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб roubando algum lugar.");
	    	return 1;
    	}
		if(PlayerToPoint(1.0,playerid, 2306.5127,-6.1166,26.7422))
		{
	    	if(roubobanco == 1)
	    	{
	   			SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma tentativa de roubo nesse cofre.");
	    		return 1;
	    	}
	    	if(temporoubobanco == 1)
	    	{
	   			SendClientMessage(playerid,COLOR_GREY,"Jб roubaram o cofre do banco espere 3 minutos para roubar de novo !");
	    		return 1;
	    	}
			GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
            format(string, sizeof(string), "%s e os %s estгo tentando roubar o cofre banco! ID:[%d]", playername, NomeORG(playerid) , playerid);
			SendClientMessageToAll(GetPlayerColor(playerid), string);
			SendClientMessage(playerid, COLOR_GRAD5, "Espere 40 segundos para terminar de roubar o banco.");
			SetPlayerCriminal(playerid,255, "Tentativa de Roubo ao Banco");
			ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
 			SetTimerEx("AnimRoubo", 500, 0, "i", playerid);
            roubando[playerid] = 1;
            ProvocoBanco[playerid] = 1;
            roubobanco = 1;
            temporoubobanco = 1;
            SetTimer("Aroubo", 220000, 0);
        	tempobanco = SetTimerEx("RouboBanco", 40000, 0, "i", playerid);
        	ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
        	return 1;
		}
public roubobanco
Code:
public RouboBanco(playerid)
{
	KillTimer(tempobanco);
	if(!PlayerToPoint(8.0,playerid,2306.5127,-6.1166,26.7422))
    {
		format(gstring, sizeof(gstring), "%s e os %s nгo conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
       	SendClientMessageToAll(GetPlayerColor(playerid), gstring);
        SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб no cofre do banco.");
        ProvocoBanco[playerid] = 0; roubando[playerid] = 0; roubobanco = 0; KillTimer(tempobanco); temporoubobanco = 0;
        return 1;
    }
	ForPlayers(i)
	{
		new grana = 1000 + random(6000);
		if(PlayerToPoint(10.0,i,2306.5127,-6.1166,26.7422))
		{
		    new var032=0;
			if (PlayerInfo[playerid][pLider] != 0) { var032 = PlayerInfo[playerid][pLider]; }
			else if (PlayerInfo[playerid][pMembro] != 0) { var032 = PlayerInfo[playerid][pMembro]; }
			if(ProvocoBanco[playerid] == 1)
            {
            	format(gstring, sizeof(gstring), "%s e os %s conseguiram roubar o cofre do Banco! ID:[%d]", PlayerName(playerid), NomeORG(playerid), playerid);
            	SendClientMessageToAll(GetPlayerColor(playerid), gstring);
            	roubando[playerid] = 0; roubobanco = 0; ProvocoBanco[playerid] = 0;
			}
			if (PlayerInfo[i][pLider] == var032 || PlayerInfo[i][pMembro] == var032)
			{
				SetPlayerCriminal(i,255, "Assalto ao Banco");
				GivePlayerMoney(i, grana);
				format(gstring, sizeof(gstring), "Vocк e os %s roubaram $%d do cofre do Banco!",NomeORG(playerid), grana);
            	SendClientMessage(i, COLOR_YELLOW, gstring);
			}
		}
	}
	return 1;
}
DAREI REP+
Coloque isso no final do comando e veja se dб, nгo testei.

pawn Code:
{
    GameTextForPlayer ( playerid, "Espere 40 segundos para terminar de roubar o banco." , 40000 , 0 ) ;
     retornar  1 ;
 }
Reply
#3

*-* nao aparece tipo 40,39.38,37....
Reply
#4

Й sу formatar a GameTextForPlayer, caso queira aparecendo os segundos. Ex;

pawn Code:
new string[60],
tempo = RouboBanco(playerid);

format(string, sizeof(string), "Falta %d para terminar de roubar", tempo);
GameTextForPlayer(string, sizeof(string), 5000);
Reply
#5

daniel boto aoonde isso
Reply
#6

pawn Code:
new Contagem[MAX_PLAYERS]; //topo do GM, abaixo das includes

if(strcmp(cmd,"/roubar",true)==0) {

    if(roubando[playerid] == 1)
        return SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб roubando algum lugar.");
   
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 2306.5127,-6.1166,26.7422)) {
   
        if(roubobanco == 1)
            return SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma tentativa de roubo nesse cofre.");
       
        if(temporoubobanco == 1)
            return SendClientMessage(playerid,COLOR_GREY,"Jб roubaram o cofre do banco espere 3 minutos para roubar de novo !");
       
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(string, sizeof(string), "%s e os %s estгo tentando roubar o cofre banco! ID:[%d]", playername, NomeORG(playerid) , playerid);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
        SendClientMessage(playerid, COLOR_GRAD5, "Espere 40 segundos para terminar de roubar o banco.");
        SetPlayerCriminal(playerid,255, "Tentativa de Roubo ao Banco");
        ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
        SetTimerEx("AnimRoubo", 500, 0, "i", playerid);
        roubando[playerid] = 1;
        ProvocoBanco[playerid] = 1;
        roubobanco = 1;
        temporoubobanco = 1;
        SetTimer("Aroubo", 220000, 0);
        tempobanco = SetTimerEx("RouboBanco", 40000, 0, "i", playerid);
        ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",1.0,1,0,0,0,0);
       
        Contagem[playerid] = 40;
        new str[10];
        format (str, 10, "~r~%d", Contagem[playerid]);
        GameTextForPlayer(playerid, str, 1500, 3);
        SetTimerEx("Contador", 1000, false, "d", playerid);
       
        return 1;
    }
    return 1;
}

forward Contador(playerid);
public Contador(playerid) {

    Contagem[playerid]--;

    if ( Contagem[playerid] > 0 ) {

        new str[10];
        format (str, 10, "~r~%d", Contagem[playerid]);
        GameTextForPlayer(playerid, str, 1500, 3);
        SetTimerEx("Contador", 1000, false, "d", playerid);

    }
    return 1;
}
Hoje em dia qualquer um "faz" um gamemode...
Reply
#7

Quote:
Originally Posted by Pablo_Mantega
View Post
daniel boto aoonde isso
No comando.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)