26.01.2014, 22:47
queria que aparecese um GameTextForPlayer de contagem de 40 segundos durante o roubo.
comando :
public roubobanco
DAREI REP+
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;
}
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;
}


