SA-MP Forums Archive
[DUV] Checar se o player estб preso - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [DUV] Checar se o player estб preso (/showthread.php?tid=152775)



[DUV] Checar se o player estб preso - [BR]Michael - 05.06.2010

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?


Re: [DUV] Checar se o player estб preso - ipsBruno - 05.06.2010

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



Re: [DUV] Checar se o player estб preso - [NWD]Tweener_ - 05.06.2010

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

[/quote]

<censored> -FikDik -AFF - assim ta bom? soubeite



Re: [DUV] Checar se o player estб preso - (o)Trydon - 05.06.2010

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


Re: [DUV] Checar se o player estб preso - [BR]Michael - 06.06.2010

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


Re: [DUV] Checar se o player estб preso - SuB_ZeRo0_ - 06.06.2010

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;
}



Re: [DUV] Checar se o player estб preso - [VGS]Protioso - 07.06.2010

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.
    }
}