[DUV] Checar se o player estб preso
#1

Galera, to com a seguinte dъvida, como eu faзo para checar se o player estб em um determinado
se ele estiver preso e estiver fora desse raio de alcance й para ele ser kickado eu fiz assim...


Criei um Timer
Код:
public ChecagemPreso(playerid)
	{
	if(pStats[playerid][Preso] == 1)
	{
  	if(IsPlayerInRangeOfPoint(playerid, 25, 264.6136,77.2980,1001.0391))
  	{
 	SendClientMessageToAll(COLOR_RED, "Alguйm saiu da cela da cela e foi kickado automбticamente");
	Kick(playerid);
}
}
}
Alguйm sabe fazer?
Reply
#2

Bastava ver meu Tuto
Faz Assim:
Final GM:
pawn Код:
stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
OnGameModeInit
pawn Код:
SetTimer("EleTaPreso",5000,true);
Agora a Public

pawn Код:
forward EleTaPreso(playerid);
public EleTaPreso(playerid)
{
if(pStats[playerid][Preso] == 1)
{
if(IsPlayerInArea(playerid, 264.6136,77.2980,1001.0391) == 0)//CORDENADAS
{
SendClientMessageToAll(COLOR_RED, "Alguйm saiu da cela da cela e foi kickado automбticamente");
Kick(playerid);
}
}
}
return 1;
}
Sу nгo entendo uma Coisa, Como Alguem Pode sair da cela?

@OFF:
Michel vocк й aquele cara que faz Mods para GTA?

ou Estou Enganado o.o
Reply
#3

Sу nгo entendo uma Coisa, Como Alguem Pode sair da cela?

[/quote]

<censored> -FikDik -AFF - assim ta bom? soubeite
Reply
#4

Quote:
Originally Posted by [NWD
Black_Alien ]

Sу nгo entendo uma Coisa, Como Alguem Pode sair da cela?
<censored> -FikDik

[/quote]
Airbreak...Teleport..Varios modos rsrs
Reply
#5

/\
Exatamente, й um mйtodo dele realmente ficar preso. Obrigado Drakon, fez eu ter uma base na ediзгo.
Reply
#6

Quote:
Originally Posted by DraKoNeoN
Bastava ver meu Tuto
Faz Assim:
Final GM:
pawn Код:
stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
OnGameModeInit
pawn Код:
SetTimer("EleTaPreso",5000,true);
Agora a Public

pawn Код:
forward EleTaPreso(playerid);
public EleTaPreso(playerid)
{
if(pStats[playerid][Preso] == 1)
{
if(IsPlayerInArea(playerid, 264.6136,77.2980,1001.0391) == 0)//CORDENADAS
{
SendClientMessageToAll(COLOR_RED, "Alguйm saiu da cela da cela e foi kickado automбticamente");
Kick(playerid);
}
}
}
return 1;
}
Sу nгo entendo uma Coisa, Como Alguem Pode sair da cela?

@OFF:
Michel vocк й aquele cara que faz Mods para GTA?

ou Estou Enganado o.o
DraKoN nгo aprendeu a fazer timer ainda? :P

SetTimer("Lol",1000,true); --> public Lol() { [[Aqui tem que usar loop para pegar todos os players]]
SetTimerEx("Lol",1000,true,"i",playerid); --> public Lol(playerid) { [[Aqui sу pega 1 player]]

Mais ou menos isso:
pawn Код:
//OnGameModeInit
SetTimer("TaPreso",5000,true);

//Publics
forward TaPreso();
public TaPreso() {
 for(new e=0;e<GetMaxPlayers();e++) {
 if(IsPlayerConnected(e)) {
  if(pStats[playerid][Preso] == 1) {
  if(!IsPlayerInArea(playerid, 264.6136,77.2980,1001.0391)) {
   new namef[25],strf[128];
   GetPlayerName(playerid,namef,25);
   format(strf,128,"|Admin| %s foi kickado por suspeita de airbreak/teleport.",namef);
   SendClientMessageToAll(COR_AQUI,strf);
   }
  }
  }
 }
 return 1;
}
Reply
#7

pawn Код:
forward ChecagemPreso(playerid);

// quando prender o truta: SetTimerEx("ChecagemPreso", 1000, 0, "d", playerid);

public ChecagemPreso(playerid)
{
    if(pStats[playerid][Preso] == 1)
    {
        if(!IsPlayerInRangeOfPoint(playerid, 25, 264.6136,77.2980,1001.0391)) // se ele estiver fora da posiзгo...
        {
            SendClientMessageToAll(COLOR_RED, "Alguйm saiu da cela da cela e foi kickado automбticamente");
            Kick(playerid);
        }
        SetTimerEx("ChecagemPreso", 1000, 0, "d", playerid); // se ele ainda estб preso o timer continua.
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)