Little help needed.
#2

pawn Код:
else if (GetPlayerState(i) == 1 && PlayerToPoint(2.0, i,2022.1492,-1108.7837,26.2031))
            {
                if(PlayerInfo[i][pMember] == 16 || PlayerInfo[i][pLeader] == 16)
                {
                    GameTextForPlayer(i, "~g~Teretulemast,~n~~y~Siin on tддpakkumine :  ~r~Narkoдrikas~n~~w~Kirjuta /liitu kui sa soovid tддkohta vastu vдtta", 5000, 3);
                }
                else
                {
                    GameTextForPlayer(i, "~r~Staff only", 5000, 3);
                }
            }
Put that code into OnPlayerKeyStageChange.

Do never use PlayerToPoint to check if the player is near of a point. Simply use IsPlayerInRangeOfPoint. You can see that when you press KEY_SECONDARY_ATTACK (default: F), it checks if you are near of a point in a circle of 3.0. If you are need of that point (that is the position of Bank entrance), it enters you in the bank and show you "Bank" as GameTextForPlayer message.
To avoid anyone enter into the bank, for exemple, simply check, after checking if the player is in range of the point (entrace of bank for that example), if the player is Member or Leader of the faction, 16, for example.
pawn Код:
if(PlayerInfo[i][pMember] == 16 || PlayerInfo[i][pLeader] == 16)
                {
So you teleport him into the bank
pawn Код:
SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid,2306.8218,-16.1652,26.7496);
                SetPlayerFacingAngle(playerid, 268);
                GameTextForPlayer(playerid, "~w~Bank", 5000, 3);
and you
PHP код:
return 1
To stop the callback OnPlayerKeyStateChange here, because if you don't stop it, it'll continue reading the rest of the code, for nothing.
If The player is not part of the faction no°16, just Show him
pawn Код:
GameTextForPlayer(i, "~r~Staff only", 5000, 3);
I did a lot to make you understand, and i recognize I don't speak english well, but I hope it helped you a little.
Reply


Messages In This Thread
Little help needed. - by Sturra - 05.07.2014, 17:41
Re : Little help needed. - by Varkoll - 05.07.2014, 18:02
Re: Re : Little help needed. - by Sturra - 05.07.2014, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)