Jump to content
  • 0

Question

Posted (edited)

Will automatically kick a player out from a map after a specified time.

Example, when a player goes into a map, after 1 minute, the player will be kick out of the map.

Thank you for helping.

[size=4]set .timeout, 60;[/size]
if ( .timeout == 0 ) set .timeout, 60;
set .respawnmap$, "Prontera";
set .respawnx, 148;
set .respawny, 380;
set .@dif, strnpcinfo(0);
set .remind[.@dif], 0;
for ( set .@i, 1; .@i <= 9; set .@i, .@i +1 )
deletearray getd(".group"+ .@i +"limit"+ .@dif), getd(".group"+ .@i +"idsize");
set .nobodycounter[.@dif], 0;
getmapxy .@map$, .@x, .@y ,1;
set .starttime[.@dif], gettimetick(0);
do {
set .remaintime[.@dif], .timeout * 1 + .starttime[.@dif] - gettimetick(0);
set .@hour[.@dif], .remainTime[.@dif] / 3600 ;
set .@min[.@dif], .remainTime[.@dif] % 3600 / 60 ;
set .@sec[.@dif], .remainTime[.@dif] % 3600 % 60 ;
delwaitingroom strnpcinfo(0);
waitingroom "Time Left = "+( ( .@hour[.@dif] )?( .@hour[.@dif] +":"):"" )+( ( .@min[.@dif] < 10 )?"0"+ .@min[.@dif]: .@min[.@dif] )+":"+( ( .@sec[.@dif] < 10 )?"0"+ .@sec[.@dif]: .@sec[.@dif] ), 0;
if ( getmapusers(.@map$) )
set .nobodycounter[.@dif], 0;
else {
set .nobodycounter[.@dif], .nobodycounter[.@dif] +1 ;
if ( .nobodycounter[.@dif] > .nobodygiveup * 1 ) break;
}
sleep 995;
} while ( .remaintime[.@dif] > 1 );
set .remaintime[.@dif], 0;
delwaitingroom "MVP Summoner#"+ .@dif;
mapwarp .@map$, .respawnmap$, .respawnx, .respawny;
end;
close2;
[/Code]

I'm not building a MVP room, just try to copy the art work from the script but can't really make it to work.

Edited by tysonlim1989

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...