31.01.2015, 09:37
(
Последний раз редактировалось FunnyBear; 31.01.2015 в 11:18.
)
Hey,
I'm trying to make a house system. If you stand on the house pickup and press F, you will enter the house. I don't want it so you can enter the house as soon as you step on the pickup.
But there's a problem. I used OnPlayerKeyStateChange to check if they pressed F whilst on the House Pickup. However I can't check if they are on a pickup because I don't want to use OnPlayerPickupPickUp
How am I able to check what pickup they are standing on because if I use pickupid on OnPlayerKeyStateChange, it will give me errors because pickupid is not recognised.
How can I solve this problem?
Thanks
I'm trying to make a house system. If you stand on the house pickup and press F, you will enter the house. I don't want it so you can enter the house as soon as you step on the pickup.
But there's a problem. I used OnPlayerKeyStateChange to check if they pressed F whilst on the House Pickup. However I can't check if they are on a pickup because I don't want to use OnPlayerPickupPickUp
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
for(new i=1; i<=CreatedHouses; i++)
{
if(pickupid == HouseInfo[i][ExitPickup])
{
KickFromHouse(playerid, i);
}
else if(pickupid == HouseInfo[i][EnterPickup])
{
if(HouseInfo[i][Owned] == 0)
{
ShowPlayerDialog(playerid, BUY_HOUSE, DIALOG_STYLE_LIST, "Buy House", "Buy this house", "Select", "Cancel");
}
else if(HouseInfo[i][Owned] == 1)
{
if(HouseInfo[i][Locked] == 1)
{
new HouseOwner[MAX_PLAYER_NAME];
GetPlayerName(playerid, HouseOwner, sizeof(HouseOwner));
if(strcmp(HouseOwner, HouseInfo[i][Owner]) != 0)
{
SendClientMessage(playerid, RED, "This house is currently locked! You cannot enter it!");
return 1;
}
}
}
}
}
}
return 1;
}
How can I solve this problem?
Thanks