[Help] - mSelection modelid clicked
#1

I have just one question - how to get clicked modelid in mSelection ? For an example, if I use mSelection for car dealership system, and if player click on Infernus, to take 75k from him.
Reply
#2

You mean that when you open specific list from mSelection and click something which function will it triger?

You are looking for
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
listid = the list you loaded so, for ex: skinlist:
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == skinlist)
    {
        if(response)
        {
            // here you code what will happend when clicked something in that list.
        }
        else SendClientMessage(playerid, COLOR_WHITE, "Canceled skin selection");
                return 1;
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by maximthepain
Посмотреть сообщение
You mean that when you open specific list from mSelection and click something which function will it triger?

You are looking for
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
listid = the list you loaded so, for ex: skinlist:
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == skinlist)
    {
        if(response)
        {
            // here you code what will happend when clicked something in that list.
        }
        else SendClientMessage(playerid, COLOR_WHITE, "Canceled skin selection");
                return 1;
    }
    return 1;
}
Nope. I'am looking for a function which will get clicked modelid, and get the price of it from a player.
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
 if(listid == ograde || listid == ostalo || listid == stolstolice)
 {
     if(response)
     {
      new str[128];
      format(str, sizeof(str), ""KUCE"Are you sure that you want to buy this object for "WHITE"$%d ?", PriceList[modelid][1]);
      ShowPlayerDialog(playerid, DIALOG_FURNITUREB, DIALOG_STYLE_MSGBOX, "House - exterior", str, "Okay", "Close");
      }
 }
 return 1;
}
Reply
#4

There's a "modelid" parameter, just use that like:
pawn Код:
if(modelid == 280) // If the modelid was 280 (LSPD skin)
{
    GivePlayerMoney(playerid, - 500); // Removes 500 money from the player
}
Reply
#5

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
There's a "modelid" parameter, just use that like:
pawn Код:
if(modelid == 280) // If the modelid was 280 (LSPD skin)
{
    GivePlayerMoney(playerid, - 500); // Removes 500 money from the player
}
Too much lines, but I don't think there's any other solution.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)