HELP with APPLYING commands for interriors
#1

Hello!

I have a command like "/drink" set up with some menus. By default the "/drink" works everywhere by just typing it.
So what Im asking is how to make the "/drink" work only in some interriors and NOT everywhere?

Do I have to make like those red circles when where standing, it allows /drink?
If so, please tell me how to do that too!


Regards,
Assyria
Reply
#2

Quote:
Originally Posted by Assyria
Hello!

I have a command like "/drink" set up with some menus. By default the "/drink" works everywhere by just typing it.
So what Im asking is how to make the "/drink" work only in some interriors and NOT everywhere?

Do I have to make like those red circles when where standing, it allows /drink?
If so, please tell me how to do that too!


Regards,
Assyria

DCMD :
dcmd_drink(playerid, params[])
{
if (GetPlayerInterior(playerid)==interiorid)
{
// code...
}
else return SendClientMessage(playerid,red,"You're Not In The Right Interior!"
}

if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
if (GetPlayerInterior(playerid)==interiorid)
{
// code...
}
else return SendClientMessage(playerid,red,"You're Not In The Right Interior!"
}
Reply
#3

Under what I put that?
Reply
#4

Quote:
Originally Posted by Assyria
Under what I put that?
where is your /drink
command anyway? is it selfmade ?
Reply
#5

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/drinks", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What would you like to drink?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");

		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
(here is the menu..)
{
Reply
#6

Quote:
Originally Posted by Assyria
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/drinks", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What would you like to drink?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");

		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
(here is the menu..)
{
first search on the internet ...hold on... Aha Here are the Interior IDs .

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/drinks", cmdtext, true, 10) == 0)
    {
        if (GetPlayerInterior(playerid)==interiorid) // Replace Interior ID With The Interior ID you want from the link i gave you
        {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What would you like to drink?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
        }
        else return SendClientMessage(playerid,0xAA0000AA,"Youre Not In The Right Place!");
        return 1;
    }
    return 0;
}
if you want that you can be in more interiors to purchase it add
pawn Код:
|| interiorid2
Add That Here :
pawn Код:
if (GetPlayerInterior(playerid)==interiorid || interiorid) // You Can Add as many as you want .

Reply
#7

Ok This is what I got right now


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/drinks", cmdtext, true, 10) == 0)
	{
		if(GetPlayerInterior(playerid)== 3 && IsPlayerInRangeOfPoint(playerid,15,-103.559165,-24.225606,1000.718750)) {
		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What would you like to drink?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
		}
		else return SendClientMessage(playerid,0xAA0000AA,"You have to be in a bar!");
		return 1;
	}
	return 0;
But when Im in the interior and even teleport to EXACTLY the position of it wants, I still get "You have to be in a bar" when /drinks

Anybody can tell whats wrong?

EDIT: Ok, I got it working!

But now I need to know how to make this thing available for many different positions!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)