Jade Posted July 30, 2018 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 33 Reputation: 0 Joined: 03/27/18 Last Seen: November 14, 2018 Share Posted July 30, 2018 (edited) how to add #LMSPOINTS on the winner? (lmspoints can be used in lms shop) im currently using this script but the winner doesnt get any lms points prontera,150,150,5 script Last Man Standing 100,{ if ( !.start ) { mes "no event at the moment"; close; } if ( .start == 2 ) { mes "event is running"; close; } if ( .register_count >= .register_limit ) { mes "this event has reach the maximum player participations"; close; } percentheal 100,100; warp "guild_vs5", 0,0; .register_aid[ .register_count ] = getcharid(3); .register_count+++; end; OnWhisperGlobal: if ( getgmlevel() < 60 ) end; //OnClock0000: // put all your start timer here OnClock0030: OnClock0430: OnClock0730: OnClock1030: OnClock1230: OnClock1630: OnClock1930: OnClock2230: //OnMinute30: if ( .start == 2 ) callsub L_resetmap; else if ( .start == 1 ) end; announce "LMS event registration start", 0; .start = 1; sleep 120000; // registration timer here announce "LMS event registration close", 0; .start = 2; sleep 3000; mapannounce "guild_vs5", "THIS IS SPARTA !!!!!", 0; if ( .register_count < .register_min ) { announce "not enough participants for LMS event", 0; mapwarp "guild_vs5", .map$, .x, .y; callsub L_resetmap; end; } gvgon "guild_vs5"; pvpon "guild_vs5"; end; OnPCDieEvent: OnPCLogoutEvent: if ( .start != 2 || strcharinfo(3) != "guild_vs5" ) end; while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++; deletearray .register_aid[.@i], 1; .register_count--; warp "SavePoint", 0,0; if ( .register_count > 1 ) end; killmonsterall "guild_vs5"; announce "congratulations ~ the winner of LMS event is "+ rid2name( .register_aid ), 0; getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize set #lmspoints,#lmspoints+1; dispbottom "Total LMS Points = "+#lmspoints; warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) ); callsub L_reset; end; L_resetmap: mapwarp "guild_vs5", .map$, .x, .y; L_reset: .start = 0; deletearray .register_aid; .register_count = 0; pvpoff "guild_vs5"; gvgoff "guild_vs5"; return; OnInit: getmapxy .map$, .x, .y, 1; .register_min = 4; // minimum amount of players to start this event, or else it auto-abort .register_limit = 50; // maximum amount of players able to participate in this event .reward_item_id = 674; .reward_item_amount = 2; end; } guild_vs5 mapflag nosave SavePoint guild_vs5 mapflag nowarp guild_vs5 mapflag nowarpto guild_vs5 mapflag noteleport guild_vs5 mapflag nomemo guild_vs5 mapflag nopenalty guild_vs5 mapflag nobranch guild_vs5 mapflag noicewall guild_vs5 mapflag pvp_noparty guild_vs5 mapflag pvp_noguild Edited July 30, 2018 by Jade Quote Link to comment Share on other sites More sharing options...
0 Alayne Posted August 9, 2018 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 342 Reputation: 170 Joined: 02/25/12 Last Seen: January 24, 2022 Share Posted August 9, 2018 No need to change the the register_aid saving or the point giving. You're just currently giving the points to the wrong person. Right now, you're checking the logout / die event, so you're on "losing char", and give points to him. You need to attach the script to the remaining char before completing the final stage. Add this line: attachrid(.register_aid[0]); After this one killmonsterall "guild_vs5"; Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted July 30, 2018 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 776 Reputation: 239 Joined: 02/11/17 Last Seen: 6 hours ago Share Posted July 30, 2018 change this line. set #lmspoints,#lmspoints+1; to set #lmspoints,#lmspoints + 1,.register_aid; Quote Link to comment Share on other sites More sharing options...
0 Jade Posted July 30, 2018 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 33 Reputation: 0 Joined: 03/27/18 Last Seen: November 14, 2018 Author Share Posted July 30, 2018 21 minutes ago, crazyarashi said: change this line. set #lmspoints,#lmspoints+1; to set #lmspoints,#lmspoints + 1,.register_aid; still no points on the winner Quote Link to comment Share on other sites More sharing options...
0 Wickedknight2 Posted August 6, 2018 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 39 Reputation: 5 Joined: 06/09/17 Last Seen: 20 hours ago Share Posted August 6, 2018 (edited) You probably need to save the Char Id, instead of the Account ID, when you use: .register_aid[ .register_count ] = getcharid(3); Change it to: .register_aid[ .register_count ] = getcharid(0); And also use the solution @crazyarashi appointed. Sorry for my bad english and good luck *getcharid(<type>{,"<character name>"}) This function will return a unique ID number of the invoking character, or, if a character name is specified, of that player. Type is the kind of associated ID number required: 0 - Character ID 1 - Party ID 2 - Guild ID 3 - Account ID 4 - Battle Ground ID 5 - Clan ID *set <variable>,<expression>{,<char_id>}; Edited August 6, 2018 by Wickedknight2 Quote Link to comment Share on other sites More sharing options...
0 Jade Posted August 9, 2018 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 33 Reputation: 0 Joined: 03/27/18 Last Seen: November 14, 2018 Author Share Posted August 9, 2018 when i changed it to this.. Quote You probably need to save the Char Id, instead of the Account ID, when you use: .register_aid[ .register_count ] = getcharid(3); Change it to: .register_aid[ .register_count ] = getcharid(0); congratulations ~ the winner of LMS event is (null) (stuck in the map, no rewards and no points given) ---- also whenever i checked .... there's still no points given ... i added dispbottom message... dispbottom "Total LMS Points = "+#lmspoints,.register_aid; but it can only be seen on the losing person .. Quote Link to comment Share on other sites More sharing options...
0 Jade Posted August 9, 2018 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 33 Reputation: 0 Joined: 03/27/18 Last Seen: November 14, 2018 Author Share Posted August 9, 2018 thank you @Alayne . fixed... just also deleted this line in setting a point. ,.register_aid Quote Link to comment Share on other sites More sharing options...
Question
Jade
how to add #LMSPOINTS on the winner? (lmspoints can be used in lms shop)
im currently using this script but the winner doesnt get any lms points
prontera,150,150,5 script Last Man Standing 100,{ if ( !.start ) { mes "no event at the moment"; close; } if ( .start == 2 ) { mes "event is running"; close; } if ( .register_count >= .register_limit ) { mes "this event has reach the maximum player participations"; close; } percentheal 100,100; warp "guild_vs5", 0,0; .register_aid[ .register_count ] = getcharid(3); .register_count+++; end; OnWhisperGlobal: if ( getgmlevel() < 60 ) end; //OnClock0000: // put all your start timer here OnClock0030: OnClock0430: OnClock0730: OnClock1030: OnClock1230: OnClock1630: OnClock1930: OnClock2230: //OnMinute30: if ( .start == 2 ) callsub L_resetmap; else if ( .start == 1 ) end; announce "LMS event registration start", 0; .start = 1; sleep 120000; // registration timer here announce "LMS event registration close", 0; .start = 2; sleep 3000; mapannounce "guild_vs5", "THIS IS SPARTA !!!!!", 0; if ( .register_count < .register_min ) { announce "not enough participants for LMS event", 0; mapwarp "guild_vs5", .map$, .x, .y; callsub L_resetmap; end; } gvgon "guild_vs5"; pvpon "guild_vs5"; end; OnPCDieEvent: OnPCLogoutEvent: if ( .start != 2 || strcharinfo(3) != "guild_vs5" ) end; while ( .register_aid != getcharid(3) && .@i < .register_count ) .@i++; deletearray .register_aid[.@i], 1; .register_count--; warp "SavePoint", 0,0; if ( .register_count > 1 ) end; killmonsterall "guild_vs5"; announce "congratulations ~ the winner of LMS event is "+ rid2name( .register_aid ), 0; getitem .reward_item_id, .reward_item_amount, .register_aid; // winner prize set #lmspoints,#lmspoints+1; dispbottom "Total LMS Points = "+#lmspoints; warpchar "SavePoint", 0,0, getcharid( 0, rid2name( .register_aid ) ); callsub L_reset; end; L_resetmap: mapwarp "guild_vs5", .map$, .x, .y; L_reset: .start = 0; deletearray .register_aid; .register_count = 0; pvpoff "guild_vs5"; gvgoff "guild_vs5"; return; OnInit: getmapxy .map$, .x, .y, 1; .register_min = 4; // minimum amount of players to start this event, or else it auto-abort .register_limit = 50; // maximum amount of players able to participate in this event .reward_item_id = 674; .reward_item_amount = 2; end; } guild_vs5 mapflag nosave SavePoint guild_vs5 mapflag nowarp guild_vs5 mapflag nowarpto guild_vs5 mapflag noteleport guild_vs5 mapflag nomemo guild_vs5 mapflag nopenalty guild_vs5 mapflag nobranch guild_vs5 mapflag noicewall guild_vs5 mapflag pvp_noparty guild_vs5 mapflag pvp_noguild
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.