10.06.2015, 01:29
I'm using this. and trying to make car shop.
Like this:
if player enter in checkpoint he gets main menu for example like:
1. Cars
2. Bikes
if he select cars by type '1' then another textdraw will be opened like
1. infernus
2. bullet
if he selects by type '2' bike then another textdraw will be opened like
1. FCR
2.PCJ
here's my code.
Like this:
if player enter in checkpoint he gets main menu for example like:
1. Cars
2. Bikes
if he select cars by type '1' then another textdraw will be opened like
1. infernus
2. bullet
if he selects by type '2' bike then another textdraw will be opened like
1. FCR
2.PCJ
here's my code.
PHP код:
public OnPlayerText(playerid, text[])
{
if(carshopdentry{playerid}) // check if player in checkpoint or what
{
switch(carshopdentry{playerid})
{
case CARSHOPBOX: // main menu like 1. cars 2. bikes
{
switch(strval(text))
{
case 1: /// here if he selects 1 then it should show this to player
{
//Show your guns textdraw here.
TextDrawShowForPlayer(playerid, CARSHOPBOX);
TextDrawShowForPlayer(playerid, vehicleshop);
}
case 2: here if he selects 2 then it should show this to player
{
//Show your food textdraw here.
TextDrawShowForPlayer(playerid, CARSHOPBOX);
TextDrawShowForPlayer(playerid, bikeshop);
}
}
}
case vehicleshop://If they selected the car i mean '1' = cars textdraw,
{
switch(strval(text))//Switch through the number they type in.
{
case 1: GivePlayerWeapon(playerid,22,50); // dnt mind this weapon i just checking it i will change it later and give vehicle to player
}
}
case bikeshop:
{
switch(strval(text))//Switch through the number they type in.
{
case 1: GivePlayerWeapon(playerid,31,50);//Give the player the weapon they typed the option for
}
}
}
return 0;
}