PDA

View Full Version : player clicked custom button


kdo
12th November 2011, 09:02
hello, i made this :

case 62:
InSim.Send_BFN_DeleteButton(0, 62, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 200, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 201, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 202, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 203, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 204, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 205, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 206, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 207, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 223, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 230, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 232, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 231, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 233, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 234, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 235, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 236, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 237, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 238, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 239, BTC.UCID);
InSim.Send_BFN_DeleteButton(0, 240, BTC.UCID);
InSim.Send_MTC_MessageToConnection("!job", BTC.UCID, 0);
int prize = new Random().Next(3, 8);
if (prize == 3)
{
InSim.Send_MTC_MessageToConnection("^3Now, delivrer a package to the Victor's house", Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);
startjob3 = 1;
isjob1 = 1;
}
if (prize == 4)
{
InSim.Send_MTC_MessageToConnection("^3Now, delivrer a package to the Mika's house", Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);
startjob4 = 1;
isjob1 = 1;
}
if (prize == 5)
{
InSim.Send_MTC_MessageToConnection("^3Now, delivrer a package to the Lisa's house", Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);
startjob5 = 1;
isjob1 = 1;
}
if (prize == 6)
{
InSim.Send_MTC_MessageToConnection("^3Now, delivrer a package to the Lee's house", Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);
startjob6 = 1;
isjob1 = 1;
}
if (prize == 7)
{
InSim.Send_MTC_MessageToConnection("^3Now, delivrer a package to the Peter's house", Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);
startjob7 = 1;
isjob1 = 1;
}
if (prize == 8)
{
InSim.Send_MTC_MessageToConnection("^3Now, delivrer a package to the Jackson Five's house", Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);
startjob8 = 1;
isjob1 = 1;
}
break;

but when i clock the button, nothing work.
how to solve it ?

hyntty
12th November 2011, 10:00
there is no button in that piece of code. That's why.

DarkKostas
12th November 2011, 10:11
there is no button in that piece of code. That's why.


His button is 62, that's why he is on BTC packet.


Are you sure ClickID when creating the button is the same as when clicking it?
Also are you sure the code with buttons is working? You can use something like

InSim.Send_MTC_MessageToConnection("^3You clicked " + BTC.ClickID, Connections[GetConnIdx(BTC.UCID)].UniqueID, 0);


so you can make sure the code is working.