Hia guys can anyone tell me were i went wrong here, all im trying to do is make a button apper on the screen to a player and give the option to take away cash.
When playerA types the command !tow (AMOUNT) playerB, it should create a few buttons to playerB saying PlayerA wants to tow you do you except yes/no, if yes then -(AMOUNT) and gives to playerA if no then says playerB refuses your offer
here's the code
thanks guys
When playerA types the command !tow (AMOUNT) playerB, it should create a few buttons to playerB saying PlayerA wants to tow you do you except yes/no, if yes then -(AMOUNT) and gives to playerA if no then says playerB refuses your offer
here's the code
[SIZE=2][COLOR=#0000ff]
[SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"!tow"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]:[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (StrMsg.Length > 2)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TradeCash = 0;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]try[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2]TradeCash = [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ToInt32(StrMsg[2]);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (TradeCash >= 0)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]foreach[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]clsConnection[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Recipient [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Connections)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (Recipient.Username == Msg.Remove(0, (9 + StrMsg[1].Length + StrMsg[2].Length)))[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (Recipient.Cash >= TradeCash)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]InSim.Send_BTN_CreateButton([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^7"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + Connections[GetConnIdx(MSO.UCID)].Username + [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]" wants to tow you."[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_LEFT, 5, 100, 30, 72, 215, Recipient.UniqueID, 40, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]InSim.Send_BTN_CreateButton([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^7Price: €"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + TradeCash, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_LEFT, 5, 100, 35, 72, 216, Recipient.UniqueID, 40, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]InSim.Send_BTN_CreateButton([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^7Do you except the tow?"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_LEFT, 5, 100, 40, 72, 217, Recipient.UniqueID, 40, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]InSim.Send_BTN_CreateButton([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^2Yes"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_C1 | [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_DARK | [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_CLICK, 5, 10, 47, 77, 218, Recipient.UniqueID, 40, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]InSim.Send_BTN_CreateButton([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^1No"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_C1 | [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_DARK | [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Flags[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]ButtonStyles[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ISB_CLICK, 5, 10, 47, 97, 219, Recipient.UniqueID, 40, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]SenderUCID = MSO.UCID;[/SIZE]
[SIZE=2]SentMoney = TradeCash;[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2]InSim.Send_MTC_MessageToConnection([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^6|^7 The recipient doesn't have enough cash!"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], MSO.UCID, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2]InSim.Send_MTC_MessageToConnection([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^6|^7 Invalid selection. Please try again"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], MSO.UCID, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]catch[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2]InSim.Send_MTC_MessageToConnection([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^6|^7 an error in code has happened please contact a admin"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], MSO.UCID, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2]InSim.Send_MTC_MessageToConnection([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"^6|^7 Invalid command. Please see ^2!help^7 for a command list"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], MSO.UCID, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
thanks guys