18.10.2012, 05:26
Hello, I making housing system. And I have a problem.
I want to make thing that player could enter the house when pressed Enter.
Here's my code:
And the problem is that, when I press Enter, I getting a lot of messages:
What I doing wrong?
I want to make thing that player could enter the house when pressed Enter.
Here's my code:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { for(new i = 0; i < sizeof(hInfo); i++) { if (IsPlayerInRangeOfPoint(playerid, 1.5,hInfo[i][enPos][0], hInfo[i][enPos][1], hInfo[i][enPos][2])) { if (PRESSED(KEY_SECONDARY_ATTACK)) { SetPlayerInterior(playerid,hInfo[i][Interior]); SetPlayerPos(playerid, hInfo[i][exPos][0], hInfo[i][exPos][1], hInfo[i][exPos][2]); } } else { SendClientMessage(playerid, COLOR_RED, "You are not standing at any house!"); } } return 1; }
Код:
You are not standing at any house!