[Ajuda] Tempo Para RouboІ
#1

Como me ajudaram e eu falei que tinha conseguido , eu testei bem direito e nгo deu certo , to tentando fazer com que quando o Player Digitar : /roubar aparecer um GameText , falando assim:
Код:
for(new tempo = 40; tempo != 1; tempo--)
			{
    		new msg[128];
    		format(msg, sizeof(msg), "~w~Tempo Para Roubar:~n~~r~%d Segundos...", tempo);
    		GameTextForPlayer(playerid, msg, 1000, 3);
    		sleep(1000);
			}
Esse ai foi o mlk que me passou no outro Topico e eu falei que tinha dado certo , pois nгo deu ele sу mostra 40 Segundos ele nгo vai tipo assim 40 , 39 ele sу mostra o 40 e Some!
Reply
#2

Reply
#3

Poxa mano, porque vocк nгo editou o outro tуpico?
І
Reply
#4

Foi mal , mano й que eu falei que ja tinha resolvido e pб , mals alguem ae pra ajudar ?
Reply
#5

Quote:
Originally Posted by MatheusFuria
Посмотреть сообщение
Foi mal , mano й que eu falei que ja tinha resolvido e pб , mals alguem ae pra ajudar ?
Nгo importa cara, vocк comentбndo lб no tуpico agente jб vai ver, e isso й contra as regras mano...

@Topic

Se eu conseguir resolver eu EDITO...
Reply
#6

Nгo Sabia, vou passar a lкr as Regras! , mals ae
Reply
#7

Poste o comando /roubo.
Reply
#8

Код:
	if(strcmp(cmd,"/roubar",true)==0)
	{
	    if(PlayerInfo[playerid][pMembro] != 5 && PlayerInfo[playerid][pLider] != 5
		&& PlayerInfo[playerid][pMembro] != 14 && PlayerInfo[playerid][pLider] != 14
		&& PlayerInfo[playerid][pMembro] != 17 && PlayerInfo[playerid][pLider] != 17
		&& PlayerInfo[playerid][pMembro] != 18 && PlayerInfo[playerid][pLider] != 18
		&& PlayerInfo[playerid][pMembro] != 19 && PlayerInfo[playerid][pLider] != 19
		&& PlayerInfo[playerid][pMembro] != 20 && PlayerInfo[playerid][pLider] != 20
		&& PlayerInfo[playerid][pMembro] != 21 && PlayerInfo[playerid][pLider] != 21
		&& GetPlayerOrg(playerid) != 6 && GetPlayerOrg(playerid) != 12
		&& GetPlayerOrg(playerid) != 13	&& GetPlayerOrg(playerid) != 15
		&& GetPlayerOrg(playerid) != 23)
	    {
			SendClientMessage(playerid,COLOR_GREY,"Vocк nгo pode assaltar !");
            return true;
		}
		if(roubando[playerid] == 1)
	    {
	   		SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб roubando algum lugar.");
	    	return true;
    	}
    	if (PlayerInfo[playerid][pDinamite] == 0)
	    	{
	    		SendClientMessage(playerid, COR_VAGOS, "Vocк nгo possui dinamites,compre de um mafioso!");
	    		return 1;
			}
		if(PlayerToPoint(2.0,playerid, 2144.4177,1641.5360,993.5761))
		{
	    	if(roubobanco == 1)
	    	{
	   			SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma tentativa de roubo nesse cofre.");
	    		return true;
	    	}
	    	if(temporoubobanco == 1)
	    	{
	   			SendClientMessage(playerid,COLOR_GREY,"Jб roubaram o cofre do banco espere 3 minutos para roubar de novo !");
	    		return true;
	    	}
			GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
            format(string, sizeof(string), "[%s] %s[%d] detonou o cofre e estб tentando roubar o banco!",NomeORG(playerid), playername, playerid);
			SendClientMessageToAll(GetPlayerColor(playerid), string);
			CreateExplosion(2144.3914,1641.8232,993.5761,6,1);
			GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
			SendClientMessage(playerid, COLOR_GRAD5, "Espere 40 segundos para terminar de roubar o banco.");
			PlayerInfo[giveplayerid][pDinamite] -= 1;
			SetPlayerCriminal(playerid,255, "Tentativa de Roubo ao Banco");
            roubando[playerid] = 1;
            ProvocoBanco[playerid] = 1;
            roubobanco = 1;
            temporoubobanco = 1;
            Controle(playerid, 0);
            SetPlayerPos(playerid, 2144.3711,1641.4792,993.5761);
            SetPlayerFacingAngle(playerid,1.2666);
            SetTimer("Aroubo", 220000, 0);
            SetTimerEx("AnimRouboBanco", 900, 0, "i", playerid);
            ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 4.0, 1, 0, 0, 1, 0);
        	tempobanco = SetTimerEx("RouboBanco", 40000, 0, "i", playerid);
        	SetPlayerAttachedObject(playerid, 0, 1550, 1, 0.000000, -0.313611, 0.021003, 0.445490, 86.754409, 355.370239, 0.926815, 1.000000, 1.000000);
        	SetTimerEx("AcabarMochila", 120000, 0, "i", playerid);
        	return true;
		}
Reply
#9

Aqui um cуdigo semelhante!

Porem ao invйs de usar SetTimer terб de usar SetTimerEx

https://sampforum.blast.hk/showthread.php?tid=281966



Boa explicaзгo sobre SetTimer e SetTimerEx:
https://sampforum.blast.hk/showthread.php?tid=309444

Dъvidas?
https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx

Bons estudos!

Atй faria o cуdigo pra vocк mas vocк nem passou o comando completo, e estou afim de olhar o 10є episуdio da 8Є temporada de Supernatural!
Reply
#10

Consegui Fazer o Sistema Pegando Base Em Outro hehe

Adiciona Isso Aki Nas News
Quote:

new Contagem[MAX_PLAYERS];
new TempoContagem[MAX_PLAYERS];

Adicionar Isso Aki Nas Suas forward
Quote:

forward ContagemHospital(playerid);

Depois Colocar Isso No Seu /roubar
Quote:

TempoContagem[playerid] = SetTimerEx("ContagemHospital", 1000, 1, "i", playerid);
Contagem[playerid] = 40;

Depois e so Colocar Isso No Final do GM

Quote:

public ContagemHospital(playerid)
{
new string[64];
format(string, sizeof(string), "~b~%d", Contagem[playerid]);
GameTextForPlayer(playerid, string, 1500, 3);
if(Contagem[playerid] == 0)
{
KillTimer(TempoContagem[playerid]);
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 100.00);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
}
Contagem[playerid]--;
}

Obs. Onde Ta o Contagem[playerid] = 40; e o Segundos Que Serгo Contandos No Seu /roubar quando o player digitar ai vai aparecer no meio da telo 40,39,e etc se quiser modificar apenas mude. blz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)