05.07.2014, 18:02
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);
}
}
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)
{
pawn Код:
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid,2306.8218,-16.1652,26.7496);
SetPlayerFacingAngle(playerid, 268);
GameTextForPlayer(playerid, "~w~Bank", 5000, 3);
PHP код:
return 1;
If The player is not part of the faction no°16, just Show him
pawn Код:
GameTextForPlayer(i, "~r~Staff only", 5000, 3);