Pomoc...

Započeo SARMA, April 18, 2010, 17:30:29 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Evo ja zelim da mi se u interior ulazi sa tipkom enter...I  imamo ovakvu komandu:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) || PlayerToPoint(5.0,playerid,1753.1857,-1912.2231,13.5677))
    {
    SetPlayerPos(playerid, -2159.122802,641.517517,1052.381713);
    SetPlayerInterior(playerid, 1);
}
else if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) || PlayerToPoint(1.0,playerid,-2159.122802,641.517517,1052.381713))
{
SetPlayerPos(playerid, 1753.1857,-1912.2231,13.5677);
    SetPlayerInterior(playerid, 0);
}
return 1;
}

I sad ja dodem do ulaza i stisnem enter ude i odma me izbaci...Da bi ostao u int-u moram kad stisnem enter jos drzat enter dok se maknem iz ovog radiusa playertopoint za izlazak...E da i uci u int mogu sa vise tipaka(space,tab,lijevi klik misa,enter), a izac mogu samo sa enter-om...
Kako da porpavim da me ne izbaciva iz int-a, nego kad jednom stisnem enter da ude...

Vraca te natrag van valjda zbog toga jer kad ti kliknes enter on te stavi unutra i ako drzis enter duze baci te van zato jer se ulazi i izlazi s istom tipkom van / unutra...Ako me razumijes sta hocu reci... ::)

EDIT: i umjesto ovoga sta si stavio || stavi &&!!
Poslednja Izmena: April 18, 2010, 21:44:29 POSLE PODNE od ✔ Slick_Crack ✔
Mysterious roleplay

Ja stisnem i pustim odma i on me izbaci...A kad stisnem i drzim i maknem se iz onog radiusa playertopoint za izlaz onda ostane unutra..Ako me kuzis..

ovo je jedan dio i u taj dio dijeliš na dva (ulaz-izlaz), ali koristiš istu komandu (enter), a pošto je to jedan dio on ga cijelog učitava od jednom, evo rješenje:

Za izlaz stavi drugu tipku

Ili napravi posebno za ulaz i izlaz: Ovako:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) || PlayerToPoint(5.0,playerid,1753.1857,-1912.2231,13.5677))
    {
    SetPlayerPos(playerid, -2159.122802,641.517517,1052.381713);
    SetPlayerInterior(playerid, 1);
}
           return 1;
}

if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) || PlayerToPoint(1.0,playerid,-2159.122802,641.517517,1052.381713))
{
SetPlayerPos(playerid, 1753.1857,-1912.2231,13.5677);
    SetPlayerInterior(playerid, 0);
}
return 1;
}



Prvo taj probaj, a ako neradi, onda je ovaj:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) || PlayerToPoint(5.0,playerid,1753.1857,-1912.2231,13.5677))
    {
    SetPlayerPos(playerid, -2159.122802,641.517517,1052.381713);
    SetPlayerInterior(playerid, 1);
}
           return 1;
}
{
if (IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys) || PlayerToPoint(1.0,playerid,-2159.122802,641.517517,1052.381713))
{
SetPlayerPos(playerid, 1753.1857,-1912.2231,13.5677);
    SetPlayerInterior(playerid, 0);
}
return 1;
}