[NEED HELP]Set spical area to work command
#1

hello


i need know how can set a area for one command
like /refull on Gas station no more place

or

ATM machines
Reply
#2

Get it's coordinates and use the function IsPlayerInRangeOfPoint
Reply
#3

must insert under player command text?
or more place?
Reply
#4

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?
Reply
#5

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)