OnPlayerKeystateChange - 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 (
/showthread.php?tid=403738)
OnPlayerKeystateChange -
Tamer - 31.12.2012
Код:
if (PRESSED(KEY_CTRL_BACK))
{
if(!IsPlayerInRangeOfPoint(playerid,5,-154.9131,2397.8865,42.5259)) return
ShowPlayerDialog(playerid,DIALOG_SHOP,DIALOG_STYLE_LIST,"Madness","Dialog does the stuff","Select", "Back");
}
return 1;
}
I use this and it works everywhere,doesn't matter if I am near the coords or not.
Re: OnPlayerKeystateChange -
Vince - 31.12.2012
It will work anywhere BUT near the coords, because that's simply what you scripted. If the player is NOT (notice the exclamation mark) in range of the point, then show the dialog.
Re: OnPlayerKeystateChange -
Tamer - 31.12.2012
if (PRESSED(KEY_CTRL_BACK))
{
if(IsPlayerInRangeOfPoint(playerid,5,-154.9131,2397.8865,42.5259)) return
ShowPlayerDialog(playerid,DIALOG_SHOP,DIALOG_STYLE _LIST,"Madness","Dialog does the stuff","Select", "Back");
}
return 1;
}
So it must be like this? But this doesn't work too.
Re: OnPlayerKeystateChange -
Threshold - 31.12.2012
Try:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CTRL_BACK)
{
if(IsPlayerInRangeOfPoint(playerid,5,-154.9131,2397.8865,42.5259))
{
ShowPlayerDialog(playerid,DIALOG_SHOP,DIALOG_STYLE_LIST,"Madness","Dialog does the stuff","Select", "Back");
}
}
return 1;
}
Re: OnPlayerKeystateChange -
Tamer - 31.12.2012
Doesn't work.