16.09.2014, 02:28
Si no dices que es lo que no funciona, que error, o no te podrнamos ayudar.
En principio veo que el timer Puerta1Tiempo tiene que ser SetTimerEx ya que lo trabajas con parametros.
Habrнa que revisar "CierraPuerta1" como lo tienes hecho. No lo he compilado, si te da algъn error me dices.
En principio veo que el timer Puerta1Tiempo tiene que ser SetTimerEx ya que lo trabajas con parametros.
pawn Код:
CMD:forzar(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 767.6719, 13.6320, 1000.7010))
{
if(Info[playerid][pLevel] > 6)
{
new time;
switch(Info[playerid][pForzarLevel])
{
case 1:
{
time = 30000;
}
case 2:
{
time = 20000;
}
case 3:
{
time = 10000;
}
}
GameTextForPlayer(i, "~r~forzando~n~~r~cerradura", 5000, 1);//Texto al forzar
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);//Animaciуn al forzar
SetTimerEx("ForzarNivel", time, false, "ii", playerid, Info[playerid][pForzarLevel]);//30 segundos forzando
} else SendClientMessageEx(playerid, COLOR_WHITE, "No eres nivel 6.");
}
return 1;
}
forward ForzarNivel(playerid, levelid);
public ForzarNivel(playerid, levelid)
{
new puerta;
new rand = random(6);
if((levelid == 1 && ((rand == 0) || (rand == 2) || (rand == 3) || (rand == 4))) || (levelid == 2 && ((rand == 0) || (rand == 2) || (rand == 4))))
{
SendClientMessage(playerid, COLOR_WHITE, "No pudiste forzar la cerradura, han avisado a las autoridades");
format(string, sizeof(string), "[Central]: Atenciуn %s, estб robando una casa.", PlayerName(playerid));
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
SetPlayerWantedLevel(playerid, 1);
Puerta1Abre[playerid] = 0;
SetTimerEx("PuertaTiempo", 30000, false, "i", playerid);
return 1;
}
SendClientMessage(playerid, COLOR_WHITE, "Forzaste exitosamente la puerta, tienes 20 segundos para irte.");
Puerta1Abre[playerid] = 0;
MoveDynamicObject(puerta1, 2250.1692, -1278.9937, 25.0409, 4.0, 0, 0, 199.0000);
SetTimer("CierraPuerta1", 20000, 0);
SetTimerEx("PuertaTiempo", 30000, false, "i", playerid);
}
forward PuertaTiempo(playerid);
public PuertaTiempo(playerid)
{
Puerta1Abre[playerid] = 1;
return 1;
}