Could someone help me with this 24/7 script?
#1

What do I put in the XYZ bit and the "interior id" for the 24/7 interior and so you do /store at the desk. Thanks

Код:
#include <a_samp>
#define SHOP_MENU 0

new init;

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/store", cmdtext, true, 10) == 0)
{
init = GetPlayerInterior(playerid);
if(IsPlayerInRangeOfPoint(playerid,4.0,x,y,z) && init == [24/7 interior id])
{
ShowPlayerDialog(playerid,SHOP_MENU,DIALOG_STYLE_L IST,"Store","Beer $50\nCiga $20","Buy","Cancel");//here you add item and price using \n[item]_[price]
return 1;
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You aren't in 24/7 store!");
}
return 1;
}
return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == SHOP_MENU)
{
if(!response)
{
SendClientMessage(playerid,0xFF0000FF,"You have canceled store menu");
}
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 50)
{
SendClientMessage(playerid,0xFF0000FF,"You don't have enough money!");
return 1;
}
else
{
GivePlayerMoney(playerid, -50);//Change price for Beer if you want
SendClientMessage(playerid,0x00FF00FF,"You have bought beer for $50.");
your variable that player now has beer
}
}
case 1:
{
if(GetPlayerMoney(playerid) < 20);
{
SendClientMessage(playerid,0xFF0000FF,"You don't have enough money!");
return 1;
}
else
{
GivePlayerMoney(playerid, -20);// Also change price of cigar here
SendClientMessage(playerid,0x00FF00FF,"You have bought ciga for $20.");
// Here insert your variable that player has
}
}
}
}
}
return 1;
}
Reply
#2

Because X,Y,Z is the location where the interior is, which is somewhere in sky, but if we don't set the interior, the player will reach to the location of the interior and start falling because we only set the position not the interior. Setting interior puts the player inside that interior and he's then gripped on the floor.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)