Bug Onplayerkeystatechange
#1

I created when the player is near pos x,y,z and when he press space server should teleport him to interior, but the bug is when he enters server automaticly put him in the interior and eject him from interion .. I TRIED ALL KEYS,
if (newkeys & KEY_SPRINT)
if ((newkeys & KEY_SPRINT) && !(oldkeys & KEY_SPRINT))
NOTE: WHEN I HOLD SPACE HE PUTS ME IN THE INTERIOR , BUT WHEN I RELEASE IT IT EJECT ME

http://www.youtube.com/watch?v=w_-0Q...ature=*********

pawn Код:
else if ((newkeys & KEY_SPRINT))
    if(IsPlayerInRangeOfPoint(playerid,3.0,1123.4500,-2036.6272,69.8872))
    {
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid,938.0398,97.6458,1001.2659);
        PlayerInfo[playerid][pInt] = 1;
        TogglePlayerControllable(playerid,0);
        GameTextForPlayer(playerid, "Ucitavanje Objekata", 5000, 5);
        SetTimerEx("UcitavanjeObejekata", 3000, false, "i", playerid);
    }
    if(IsPlayerInRangeOfPoint(playerid,3.0,938.0398,97.6458,1001.2659))
    {
        SetPlayerPos(playerid,1123.4500,-2036.6272,69.8872);
        GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
        SetPlayerInterior(playerid, 0);
        PlayerInfo[playerid][pInt] = 0;
    }
Reply
#2

a simple elseif would solve the problem
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,3.0,1123.4500,-2036.6272,69.8872))
{
    //code
}else if(IsPlayerInRangeOfPoint(playerid,3.0,938.0398,97.6458,1001.2659))
{
    //code
}
Reply
#3

pawn Код:
else if ((((newkeys & (KEY_SPRINT)) == (KEY_SPRINT)) && ((oldkeys & (KEY_SPRINT)) != (KEY_SPRINT))))
{
    if(IsPlayerInRangeOfPoint(playerid,3.0,1123.4500,-2036.6272,69.8872))
    {
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid,938.0398,97.6458,1001.2659);
        PlayerInfo[playerid][pInt] = 1;
        TogglePlayerControllable(playerid,0);
        GameTextForPlayer(playerid, "Ucitavanje Objekata", 5000, 5);
        SetTimerEx("UcitavanjeObejekata", 3000, false, "i", playerid);
    }
    else if(IsPlayerInRangeOfPoint(playerid,3.0,938.0398,97.6458,1001.2659))
    {
        SetPlayerPos(playerid,1123.4500,-2036.6272,69.8872);
        GameTextForPlayer(playerid, "~w~Los Santos", 5000, 1);
        SetPlayerInterior(playerid, 0);
        PlayerInfo[playerid][pInt] = 0;
    }
}
Reply
#4

Fixed it alone . ty all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)