[Help] - mSelection modelid clicked - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] - mSelection modelid clicked (
/showthread.php?tid=568956)
[Help] - mSelection modelid clicked -
SpaMaster - 26.03.2015
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.
Re: [Help] - mSelection modelid clicked -
maximthepain - 26.03.2015
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;
}
Re: [Help] - mSelection modelid clicked -
SpaMaster - 26.03.2015
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;
}
Re: [Help] - mSelection modelid clicked -
CalvinC - 26.03.2015
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
}
Re: [Help] - mSelection modelid clicked -
SpaMaster - 26.03.2015
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.