Bisuke Posted April 19, 2017 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 177 Reputation: 10 Joined: 04/02/12 Last Seen: November 2, 2024 Share Posted April 19, 2017 Is there a way where I can script my event where it detects if the players inside the map "guild_vs1" are still alive every x number of seconds? Quote Link to comment Share on other sites More sharing options...
0 Cyro Posted April 19, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 1138 Reputation: 290 Joined: 04/29/13 Last Seen: July 20, 2024 Share Posted April 19, 2017 (edited) set map1,getmapusers("guildvs3"); OnMinute01: OnMinute02: OnMinute05: OnMinute10: OnMinute15: OnMinute20: OnMinute25: OnMinute30: OnMinute35: OnMinute40: OnMinute45: OnMinute50: OnMinute55: OnMinute00: announce "Total of "+.@map1+" Players in this Map.",0; if(map1 >= 0); mes "All ther players in map is dead!"; end; Edited April 19, 2017 by Cyro Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted April 19, 2017 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 776 Reputation: 239 Joined: 02/11/17 Last Seen: Yesterday at 01:17 PM Share Posted April 19, 2017 22 minutes ago, Bisuke said: Is there a way where I can script my event where it detects if the players inside the map "guild_vs1" are still alive every x number of seconds? I dont know what event is that but you can use getmapuser to get the number of players inside :)) and if someone die just use OnPCDieEvent to warp them out :)) Quote Link to comment Share on other sites More sharing options...
0 Bisuke Posted April 19, 2017 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 177 Reputation: 10 Joined: 04/02/12 Last Seen: November 2, 2024 Author Share Posted April 19, 2017 17 minutes ago, crazyarashi said: I dont know what event is that but you can use getmapuser to get the number of players inside :)) and if someone die just use OnPCDieEvent to warp them out :)) The Thing is, I don't want to warp them out of the map. It's a survival event, and players are allowed to resurrect other players. However, I want to create a script that will active as soon as all the players are dead, the event will be closed and all the dead players will be warped out. Quote Link to comment Share on other sites More sharing options...
0 Cyro Posted April 19, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 1138 Reputation: 290 Joined: 04/29/13 Last Seen: July 20, 2024 Share Posted April 19, 2017 8 minutes ago, Bisuke said: The Thing is, I don't want to warp them out of the map. It's a survival event, and players are allowed to resurrect other players. However, I want to create a script that will active as soon as all the players are dead, the event will be closed and all the dead players will be warped out. isnt it working? Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 19, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 19, 2017 (edited) Try - script tesqweqweast -1,{ OnInit: initnpctimer; end; OnTimer5000: stopnpctimer; deletearray .players; addrid(5,1,"guild_vs1"); .players[getarraysize(.players)] = getcharid(3); detachrid; while( .@i < getarraysize(.players) ){ if( attachrid( .players[.@i] ) ) if( HP && compare( strcharinfo(3),"guild_vs1" ) ) .@alive++; .@i++; } if( .@alive ){ initnpctimer; end; } deletearray .players; announce "Players are all the dead",0; mapwarp "guild_vs1","prontera",155,181; end; } Edited April 19, 2017 by Technoken 1 Quote Link to comment Share on other sites More sharing options...
0 Bisuke Posted April 20, 2017 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 177 Reputation: 10 Joined: 04/02/12 Last Seen: November 2, 2024 Author Share Posted April 20, 2017 23 hours ago, Technoken said: Try - script tesqweqweast -1,{ OnInit: initnpctimer; end; OnTimer5000: stopnpctimer; deletearray .players; addrid(5,1,"guild_vs1"); .players[getarraysize(.players)] = getcharid(3); detachrid; while( .@i < getarraysize(.players) ){ if( attachrid( .players[.@i] ) ) if( HP && compare( strcharinfo(3),"guild_vs1" ) ) .@alive++; .@i++; } if( .@alive ){ initnpctimer; end; } deletearray .players; announce "Players are all the dead",0; mapwarp "guild_vs1","prontera",155,181; end; } Thank you for this reply, but I tried this code and it seems that the code is not working. Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 20, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 20, 2017 15 minutes ago, Bisuke said: Thank you for this reply, but I tried this code and it seems that the code is not working. I just test the script and it's working fine with me. However, it only run once. If you are going to insert the code inside your custom npc you should have a script that executed initnpctimer whenever the event starts. Also maybe increase the Timer to 30000(30 secs), so it won't be checking too fast. Quote Link to comment Share on other sites More sharing options...
0 Stolao Posted April 20, 2017 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Share Posted April 20, 2017 You could instead run a while loop using addrid(1) and check if HP > 0 Quote Link to comment Share on other sites More sharing options...
0 Bisuke Posted April 21, 2017 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 177 Reputation: 10 Joined: 04/02/12 Last Seen: November 2, 2024 Author Share Posted April 21, 2017 Oh, I see, Thank you again, @Technoken and @Stolao This weekend, I will try again your codes, I haven't had the time to test it properly because of my schedule. I'll let you know the results. Quote Link to comment Share on other sites More sharing options...
Question
Bisuke
Is there a way where I can script my event where it detects if the players inside the map "guild_vs1" are still alive every x number of seconds?
Link to comment
Share on other sites
9 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.