1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: switch player question?
[Re: lomeniki]
#79908
06/29/06 16:59
06/29/06 16:59
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
I'm back  Try this code. (Not tested, but just post any errors) Code:
///////////////////////////////////////// // On mouse-over bmap pl1_hover = <YOUR_BMAP>; bmap pl2_hover = <YOUR_BMAP>; bmap pl3_hover = <YOUR_BMAP>; bmap pl4_hover = <YOUR_BMAP>; // Normal bmap pl1_normal = <YOUR_BMAP>; bmap pl2_normal = <YOUR_BMAP>; bmap pl3_normal = <YOUR_BMAP>; bmap pl4_normal = <YOUR_BMAP>; // Other bmaps bmap cancel_but = <YOUR_BMAP>; ///////////////////////////////////////// // Player models string pl1_mdl = <MODEL>; string pl2_mdl = <MODEL>; string pl3_mdl = <MODEL>; string pl4_mdl = <MODEL>; string* ptr_string; // String pointer ///////////////////////////////////////// // Constants define numStrings,4; ///////////////////////////////////////// // Variables var ptrs_set = 0; var string_ptrs[numStrings]; ///////////////////////////////////////// // Function prototypes function plSelect(but,pan); function plSelect_cancel(); ///////////////////////////////////////// panel plSelectionPan { flags = refresh; button = 20,20,pl1_hover,pl1_normal,pl1_hover,plSelect,null,null; button = 20,50,pl2_hover,pl2_normal,pl2_hover,plSelect,null,null; button = 20,80,pl3_hover,pl3_normal,pl3_hover,plSelect,null,null; button = 20,110,pl4_hover,pl4_normal,pl4_hover,plSelect,null,null; button = 20,140,pl4_hover,pl4_normal,pl4_hover,plSelect,null,null; button = 20,170,cancel_but,cancel_but,cancel_but,plSelect_cancel,null,null; } ///////////////////////////////////////// function setStrings() { string_ptrs[0] = handle(pl1_mdl); string_ptrs[1] = handle(pl2_mdl); string_ptrs[2] = handle(pl3_mdl); string_ptrs[3] = handle(pl4_mdl); ptrs_set = 1; } ///////////////////////////////////////// function plSelect(but,pan) { if(!player) {return;} if(!ptrs_set) {setStrings();} if(but <= 0 || but > numStrings) {return;} ptr_string = ptr_for_handle(string_ptrs[but - 1]); ent_morph(player,ptr_string); plSelectionPan.visible = off; } ///////////////////////////////////////// function plSelect_cancel() { plSelectionPan.visible = off; } ///////////////////////////////////////// function showPlslPan() { plSelectionPan.pos_x = (screen_size.x - bmap_width(plSelectionPan.bmap)) / 2; plSelectionPan.pos_y = (screen_size.y - bmap_height(plSelectionPan.bmap)) / 2; plSelectionPan.visible = on; } on_mouse_right = showPlslPan; /////////////////////////////////////////
Save it as player_selection.wdl, and add this to the includes in your level's WDL (LEVELNAME.wdl) file: include <player_selection.wdl>;
|
|
|
Re: switch player question?
[Re: lomeniki]
#79911
06/29/06 20:16
06/29/06 20:16
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Oh sry, forgot this one Code:
bmap plSelectMap = <YOUR_BMAP>; panel plSelectionPan { bmap = plSelectMap; flags = refresh; button = 20,20,pl1_hover,pl1_normal,pl1_hover,plSelect,null,null; button = 20,50,pl2_hover,pl2_normal,pl2_hover,plSelect,null,null; button = 20,80,pl3_hover,pl3_normal,pl3_hover,plSelect,null,null; button = 20,110,pl4_hover,pl4_normal,pl4_hover,plSelect,null,null; button = 20,140,pl4_hover,pl4_normal,pl4_hover,plSelect,null,null; button = 20,170,cancel_but,cancel_but,cancel_but,plSelect_cancel,null,null; }
That should fix it... But one thing I noticed in the error msg u wrote: Quote:
Invalid arguments in showPlslPan: plSelectionPan.ps_x=(screen_size.x-bmap_width(plSelectionPan.bmap))/2
should've been pos_x, but that's right in the code I posted, so maybe u just forgot the 'o' when writing the error message.. ;P
|
|
|
Re: switch player question?
[Re: Claus_N]
#79914
06/29/06 21:46
06/29/06 21:46
|
Joined: Jun 2006
Posts: 32
lomeniki
OP
Newbie
|
OP
Newbie
Joined: Jun 2006
Posts: 32
|
Do not work. Same situation like before. oops,not like before. Before the player walk forward when i click rmb ,now nothing happens & when i hit "esc" button to quit game, lost higlite so must count buttons to hit the good one.
Last edited by lomeniki; 06/29/06 21:58.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|