[Pedido] Ao morrer pra policia ir preso
#4

Inнcio do GameMode:
pawn Код:
new Preso[MAX_PLAYERS];
new TempoPreso[MAX_PLAYERS];
OnPlayerDeath:
pawn Код:
if(IsACop(killerid))
{
      if(GetPlayerWantedLevel(playerid) == 1)
      {
            Preso[playerid] = 1;
            TempoPreso[playerid] = 180;
            SetPlayerWantedLevel(playerid, 0);
            SetPlayerPosition(playerid, X, Y, Z);
      }
      else if(GetPlayerWantedLevel(playerid) == 2)
      {
            Preso[playerid] = 1;
            TempoPreso[playerid] = 360;
            SetPlayerWantedLevel(playerid, 0);
            SetPlayerPosition(playerid, X, Y, Z);
      }
      else if(GetPlayerWantedLevel(playerid) == 3)
      {
            Preso[playerid] = 1;
            TempoPreso[playerid] = 540;
            SetPlayerWantedLevel(playerid, 0);
            SetPlayerPosition(playerid, X, Y, Z);
      }
      else if(GetPlayerWantedLevel(playerid) == 4)
      {
            Preso[playerid] = 1;
            TempoPreso[playerid] = 720;
            SetPlayerWantedLevel(playerid, 0);
            SetPlayerPosition(playerid, X, Y, Z);
      }
      else if(GetPlayerWantedLevel(playerid) == 5)
      {
            Preso[playerid] = 1;
            TempoPreso[playerid] = 900;
            SetPlayerWantedLevel(playerid, 0);
            SetPlayerPosition(playerid, X, Y, Z);
      }
      else if(GetPlayerWantedLevel(playerid) == 6)
      {
            Preso[playerid] = 1;
            TempoPreso[playerid] = 1080;
            SetPlayerWantedLevel(playerid, 0);
            SetPlayerPosition(playerid, X, Y, Z);
      }
}
Em seu gamemode deve ter alguma public com timer para verificar se o Player estб preso.
Vocк adiciona nela.
pawn Код:
if(Preso[playerid] >= 1)
{
      PlayerInfo[playerid][Tempopreso]--;
}
if(TempoPreso[playerid] <= 1)
{
      SetPlayerPosition(playerid, X, Y, Z);
      SendClientMessage(playerid, -1, "Livre");
      Preso[playerid] = 0;
      TempoPreso[playerid] = 0;
}
Esse sistema acima nгo salva se o Player Estб, entгo й sу trocar as variбveis TempoPreso, e Preso pelas variбveis do seu GameMode.
Reply


Messages In This Thread
Ao morrer pra policia ir preso - by maikons - 22.11.2013, 00:58
Re: Ao morrer pra policia ir preso - by Diogennes - 22.11.2013, 01:06
Re: Ao morrer pra policia ir preso - by maikons - 22.11.2013, 01:26
Re: Ao morrer pra policia ir preso - by Diogennes - 22.11.2013, 12:41
Re: Ao morrer pra policia ir preso - by DannielCooper - 22.11.2013, 12:51

Forum Jump:


Users browsing this thread: 1 Guest(s)