27.02.2014, 20:49
How to make something similar? I just know how to make it as dialog but not like this..
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;
}
I know, i got the textdraw ready but how can i do so the player like a chastity belt if he choose #3 ?
|
public OnPlayerText(playerid, text[])
{
if(ShowingTextdraw[playerid] == true)
{
if(strval(text) == 1)
{
//your actions
return 0; //return to 0 always
}
if(strval(text) == 2)
{
//your actions
return 0;
}
if(strval(text) == 3)
{
//your actions
return 0;
}
}
return 1;
}