[NEED HELP]Set spical area to work command - 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: [NEED HELP]Set spical area to work command (
/showthread.php?tid=444804)
[FIXED]Set spical area to work command -
5002 - 18.06.2013
hello
i need know how can set a area for one command
like /refull on Gas station no more place
or
ATM machines
Re: [NEED HELP]Set spical area to work command -
Red_Dragon. - 18.06.2013
Get it's coordinates and use the function IsPlayerInRangeOfPoint
Re: [NEED HELP]Set spical area to work command -
5002 - 18.06.2013
must insert under player command text?
or more place?
Re: [NEED HELP]Set spical area to work command -
5002 - 18.06.2013
i do it in this code
Код:
if (strcmp(cmdtext, "/Refull", true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 1937.8898, -1769.1318, 13.3828))
{
ShowPlayerDialog(playerid,2, DIALOG_STYLE_LIST, "Choose Amount","big tank 100%(20$) \nMedium tank 50%(10$) \nSmall tank 20%(5$)","BUY","Cancel");
}
else
{
SendClientMessage(playerid, -1, "You must stay on "COLOR_YELLOW_EMBED"Gas Station"COLOR_WHITE_EMBED"to refull");
return 1;
}
}
return 0;
}
it work but when i type refull on gas station first spot wrong command
but after it i see my dialog about full
whats prob?
Re: [NEED HELP]Set spical area to work command -
5002 - 18.06.2013
fixed must delet return 1 and 0 and insert return 1 on next }
Код:
if(IsPlayerInRangeOfPoint(playerid, 8.0, 1937.8898, -1769.1318, 13.3828))
{
ShowPlayerDialog(playerid,2, DIALOG_STYLE_LIST, "Choose Amount","big tank 100%(20$) \nMedium tank 50%(10$) \nSmall tank 20%(5$)","BUY","Cancel");
}
else
{
SendClientMessage(playerid, -1, "You must stay on "COLOR_YELLOW_EMBED"Gas Station"COLOR_WHITE_EMBED"to refull");
}
}
return 1;
}