23.12.2016, 18:57
Criei uma pickup pra setar tal interior, atй ai tudo bem, compila certinho.. sу que quando o player chega na pickup, ela some e nгo da pra apertar enter.. me ajudem pff!
interior = CreatePickup(pickupid, 1, X,Y,Z, -1);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys==KEY_SECONDARY_ATTACK)) // Key ( F / Enter )
{
OnPlayerCommandText(playerid,"/entrar"); // Ao Apertar "F" Funcionarб o Comando Do Lado.
OnPlayerCommandText(playerid,"/sair"); // Ao Apertar "F" Funcionarб o Comando Do Lado.
}
return 1;
}
CMD:entrar(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1154.0200,-1772.6787,16.5992))
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid,1491.8854,1305.9750,1093.2964); // Setado Para Aqui ( TELE )
}
return 1;
}
CMD:sair(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1494.3815,1303.5789,1093.2891))
{
SetPlayerInterior(playerid, 0); // Setando o Interior ao Sair.
SetPlayerPos(playerid, 1154.0200,-1772.6787,16.5992); // Setado Para Aqui ( TELE )
}
return 1;
}
OnPlayerCommandText(playerid,"/entrar");
cmd_entrar(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1154.0200,-1772.6787,16.5992)) {
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid,1491.8854,1305.9750,1093.2964);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1494.3815,1303.5789,1093.2891)) {
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1154.0200,-1772.6787,16.5992);
}
}
return 1;
}