[Ajuda] Entrar/sair por pickup
#7

Quote:
Originally Posted by Matei123
Посмотреть сообщение
Deletei A

Mais Quando O Play CHEGA NA Pickup Ela Some
Seta o tipo da pickup para 1

pawn Код:
public OnGameModeInit()
{
    EntradaPickup = CreatePickup(1239, 1, 1219.2214,-1812.4926,16.5938, -1);
    SaidaPickup = CreatePickup(1239, 1, 390.5518,173.7656,1008.3828, -1);
    return 1;
}
https://sampwiki.blast.hk/wiki/PickupTypes

para o seu problema:

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
    {
        OnPlayerCommandText(playerid,"/entrar");  
        OnPlayerCommandText(playerid,"/sair");  
    }
    return 1;
}

/*----------------*/

public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/entrar", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,1219.2214,-1812.4926,16.5938))
   {
       SetPlayerInterior(playerid, 11);
SetPlayerPos(playerid, 1503.3359, 1432.3585, 10.1191);
}
   return 1;
}
if(strcmp(cmdtext, "/sair", true) == 0)  
{
   
   if(IsPlayerInRangeOfPoint(playerid, 2.0, 390.5518,173.7656,1008.3828))
   {
      SetPlayerInterior(playerid, 0);  
      SetPlayerPos(playerid, 2695.6880, -1704.6300, 11.8438);  
   }
   return true;  
}
   return 1;
}
O problema й que OnPlayerPickUpPickUP activa diretamente o codigo quando voзe toca na Pickup

Voзe tem que usar IsPlayerInRangeOfPoint em OnPlayerKeyStateChange se voзe quiser que seja usado um buttao do teclado em uma pickup
Reply


Messages In This Thread
Entrar/sair por pickup - by Matei123 - 02.09.2015, 20:11
Respuesta: Ajuda - by TorresPutado - 02.09.2015, 20:27
Re: Ajuda - by zPain - 02.09.2015, 20:29
Re: Ajuda - by IgorLuiz - 02.09.2015, 20:29
Re: Ajuda - by DouglasRodrigues - 02.09.2015, 20:31
Re: Ajuda - by Matei123 - 02.09.2015, 20:53
Re: Ajuda - by Andre02 - 02.09.2015, 21:01
Re: Ajuda - by Matei123 - 02.09.2015, 21:55
Re: Ajuda - by iTakelot - 02.09.2015, 22:02
Re: Ajuda - by Matei123 - 02.09.2015, 22:03

Forum Jump:


Users browsing this thread: 4 Guest(s)