10.02.2012, 22:33
Hello.
I know I am new and actually I just began learning what pawno was the other day. The only past scripting I have had is Call of Duty World at War scripting but that is a bit different. I have learned a lot already and I am trying to make my /buy command for my Gamemode.
Here is what I have so far...
What I want is, I want each one of those to offer health points when I select it.
For example: Potato Chips will increase my health by 20 health points.
Water will increase my health by 5 health points.
Cola will increase my health by 10.
Cookies will increase my health by 15.
If someone could do that I will rep them! Also I want to learn what you did so I don't have to ask next time!
So if you could write a small explanation that would be great.
Thanks!
I know I am new and actually I just began learning what pawno was the other day. The only past scripting I have had is Call of Duty World at War scripting but that is a bit different. I have learned a lot already and I am trying to make my /buy command for my Gamemode.
Here is what I have so far...
PHP код:
#include <a_samp>
#define SHOP_MENU 0
new getinterior;
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buy", cmdtext, true, 10) == 0)
{
getinterior = GetPlayerInterior(playerid);
if(IsPlayerInRangeOfPoint(playerid,5.0, -30.8246,-28.4104,1003.5573)) && getinterior == [24/7 interior id])
{
ShowPlayerDialog(playerid,SHOP_MENU,DIALOG_STYLE_LIST,"General Store","Potato Chips $10\n Cookies $8\n Water $3\n Cola $6","Purchase","Cancel");
return 1;
}
else
{
SendClientMessage(playerid,0xFF0000AA,"You aren't in a General Store store!");
}
return 1;
}
return 0;
}
For example: Potato Chips will increase my health by 20 health points.
Water will increase my health by 5 health points.
Cola will increase my health by 10.
Cookies will increase my health by 15.
If someone could do that I will rep them! Also I want to learn what you did so I don't have to ask next time!
So if you could write a small explanation that would be great.
Thanks!