car shop/dealer
#6

Ok, thats what I meant.. Give me 10 minutes, I'll try to fix something for you.

Ok, I got you a small function, which checks if the player is in the area, when he types /buy. Now, you will have to use ShowPlayerDialog, to get a menu popped up.

Under OnPlayerCommandText:
pawn Код:
if(strcmp(cmdtext,"/buy", true) == 0)
    {
      if(IsPlayerInArea(playerid, -2000.689, -1915.71, 262.6848, 329.7492))
      {
            //do the actions (ShowPlayerDialog)
        }
        else
        {
          SendClientMessage(playerid,0xFF0000AA,"You are not in the required area!");
        }
        return 1;
    }
At the bottom of your script (you dont need this code, you dont have to understand it either):
pawn Код:
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
return 0;
}
Reply


Messages In This Thread
car shop/dealer - by security - 24.02.2010, 18:40
Re: car shop/dealer - by VonLeeuwen - 24.02.2010, 18:45
Re: car shop/dealer - by security - 24.02.2010, 18:55
Re: car shop/dealer - by VonLeeuwen - 24.02.2010, 19:07
Re: car shop/dealer - by security - 24.02.2010, 19:15
Re: car shop/dealer - by VonLeeuwen - 24.02.2010, 19:25
Re: car shop/dealer - by security - 24.02.2010, 19:32

Forum Jump:


Users browsing this thread: 1 Guest(s)