01.03.2014, 10:47
(
Последний раз редактировалось Smileys; 01.03.2014 в 11:19.
)
when the player types a numer in the textbox, check if the dialog is being shown to the player.
if it is, check what number the player typed.
get the info from either an array, or use a static way to script it.
check if the player has the certain amount of money, or more than that.
something like
if it is, check what number the player typed.
get the info from either an array, or use a static way to script it.
check if the player has the certain amount of money, or more than that.
something like
pawn Код:
enum E_TEXT_DATA
{
tName[ 35 ],
tAmount
}
new TextData[ 5 ][ E_TEXT_DATA ] =
{
{ "Adrenaline Pill", 75000 },
{ "Drugs 50g", 10000 },
{ "Chastity Belt", 15000 },
{ "Weapons", 0 },
{ "Fighting Style", 20000 }
};
public OnPlayerText(playerid, text[])
{
if( /* check if the textdraw box is shown */ )
{
new Number = ( text[ 0 ] -1 );
if( GetPlayerMoney( playerid ) >= TextData[ Number ][ tAmount ] )
{
GivePlayerMoney( playerid, -TextData[ Number ][ tAmount ] );
// give the items here.
}
else SendClientMessage( playerid, -1, "You haven't got enough money to purchase this item!" );
}
return 1;
}