Onplayerkeystatechange HELP! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Onplayerkeystatechange HELP! (
/showthread.php?tid=403163)
Onplayerkeystatechange HELP! -
Saddin - 29.12.2012
Hi all, I have a house system that if you hit enter you teleport into the house interior, but when are you in interior when you type enter again you get again into interior but no outside the house. Here is the code:
When you are outside and teleport you into interior:
Код:
if( newkeys == KEY_SECONDARY_ATTACK)
{
SetPVarInt(playerid, "LastHouseCP", h);
if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
{
SetPlayerHouseInterior(playerid, h);
ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
break;
}
format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
if(GetPVarInt(playerid, tmpstring) == 1)
{
SetPlayerHouseInterior(playerid, h);
break;
}
When I am in the interior and want to get out of the house:
Код:
if( newkeys == KEY_SECONDARY_ATTACK)
{
switch(GetPVarInt(playerid, "HousePreview"))
{
case 0: ExitHouse(playerid, h);
#if GH_HINTERIOR_UPGRADE == true
case 1:
{
GetPVarString(playerid, "HousePrevName", tmpstring, 50);
format(string, sizeof(string), HMENU_BUY_HINTERIOR, tmpstring, GetPVarInt(playerid, "HousePrevValue"));
ShowPlayerDialog(playerid, HOUSEMENU+17, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
}
#endif
}
break;
}
Help.