28.01.2013, 21:57
Galera como faзo pra quando o Player digita /roubar ele с perde life, pq coloquei explosгo, mas quando digita ele perde life, ai como faзo pra ele ficar imune por uns 3 segundos, para с perde o life.
E ja tira uma duvida, pq esse Anim de roubo as vezes falha??
pawn Код:
if(strcmp(cmd,"/roubar",true)==0)
{
if(PlayerInfo[playerid][pMembro] != 0 && PlayerInfo[playerid][pLider] != 0
&& PlayerInfo[playerid][pMembro] != 5 && PlayerInfo[playerid][pLider] != 5
&& PlayerInfo[playerid][pMembro] != 6 && PlayerInfo[playerid][pLider] != 6
&& PlayerInfo[playerid][pMembro] != 8 && PlayerInfo[playerid][pLider] != 8
&& PlayerInfo[playerid][pMembro] != 10 && PlayerInfo[playerid][pLider] != 10
&& PlayerInfo[playerid][pMembro] != 12 && PlayerInfo[playerid][pLider] != 12
&& PlayerInfo[playerid][pMembro] != 13 && PlayerInfo[playerid][pLider] != 13
&& PlayerInfo[playerid][pMembro] != 14 && PlayerInfo[playerid][pLider] != 14
&& PlayerInfo[playerid][pMembro] != 15 && PlayerInfo[playerid][pLider] != 15
&& 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
&& PlayerInfo[playerid][pMembro] != 22 && PlayerInfo[playerid][pLider] != 22
&& PlayerInfo[playerid][pMembro] != 23 && PlayerInfo[playerid][pLider] != 23
&& PlayerInfo[playerid][pMembro] != 25 && PlayerInfo[playerid][pLider] != 25)
{
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 1;
}
if(PlayerToPoint(2.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);
CreateExplosion(2306.5127,-6.1166,26.7422, 12, 10.0);
SetPlayerAttachedObject(playerid, 0, 1550, 1, 0.000000, -0.313611, 0.021003, 0.445490, 86.754409, 355.370239, 0.926815, 1.000000, 1.000000);
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, COLOR_GRAD5, "Espere 60 segundos para terminar de roubar o banco.");
SetPlayerCriminal(playerid,255, "Tentativa de Roubo ao Banco");
roubando[playerid] = 1;
ProvocoBanco[playerid] = 1;
roubobanco = 1;
temporoubobanco = 1;
SetTimer("Aroubo", 220000, 0);
tempobanco = SetTimerEx("RouboBanco", 60000, 0, "i", playerid);
return 1;
}
Код:
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);