Jump to content
  • 0

Kick player out of map after vip expire


Question

8 answers to this question

Recommended Posts

  • 0
Posted

What map? How do the players get to the map? If it's viper only then check onpcloadmapevent... then run a loop timer on players that have entered that map and check their status... if expire warp out.  

  • 0
Posted
32 minutes ago, Z3R0 said:

What map? How do the players get to the map? If it's viper only then check onpcloadmapevent... then run a loop timer on players that have entered that map and check their status... if expire warp out.  

My custom map , only vip members.

But onpcloadmapevent its only loading the map correct?

If the player is inside the map and the VIP expires he will not be kicked off the map.

 

 

  • 0
Posted

Right but I am assuming viper players use either a warp or npc to get to that map... meaning u could record all the charid... that go there into an array... using a check say every OnMinute15: loop through array and delete any chars from the array that are no longer logged in or on that map... and check their expire times... if their time is expired then boot em... if they onpcloadmapevent ... meaning they logged out on that map and warped back in check their viper and either kick em if expired or add their code back into the array

  • 0
Posted (edited)
1 hour ago, Z3R0 said:

Right but I am assuming viper players use either a warp or npc to get to that map... meaning u could record all the charid... that go there into an array... using a check say every OnMinute15: loop through array and delete any chars from the array that are no longer logged in or on that map... and check their expire times... if their time is expired then boot em... if they onpcloadmapevent ... meaning they logged out on that map and warped back in check their viper and either kick em if expired or add their code back into the array

Here's my current teleporter script

prontera,142,179,6    script    Teleporter Vip Room    984,{
    mes "[ ^0065DFHueRO Vip Room Warper^000000 ]";
    mes "Would you like to enter";
    mes "the HueRO Vip Room?";
    next;
    if (select("Yes!","No thanks.") == 2) close;
    if(vip_status(1)){
    warp "vip_room",360,61;
    }else{
        mes "";
        mes "You are not vip, please get your vip in the npc  ^0065DFHueRO Vip System^000000";
    }
    close;
}

-    script    kickmap_vip    -1,{
    
    OnPCLoadMapEvent:
        
        if ( strcharinfo(3) == "vip_room" && !vip_status(1) && getgmlevel()==0) {
            warp "SavePoint",0,0;
        }
        
}


vip_room    mapflag    loadevent

That way it works but only when loading a map, but if the vip expires inside the map he can stay in there until you logout

How would I get your idea from this script?

Edited by Puera
  • 0
Posted
22 minutes ago, Puera said:

Aqui está o meu script de teleporter atual

Prontera 142,179,6 script Teleporter Vip Room 984, {
    mes "[^ 0065DFHueRO Vip Room Warper ^ 000000]";
    Mes "Deseja entrar";
    Show "HueRO Vip Room?";
    Próximo;
    Se (selecione ("Sim!", "Não, obrigado.") == 2) feche;
    Se (vip_status (1)) {
    warp "vip_room", 360,61;
    } Else {
        mes "";
        Mes "Você não é vip, pegue seu vip no npc ^ 0065DFHueRO Vip System ^ 000000";
    }
    Fechar;
}

- script kickmap_vip -1, {
    
    OnPCLoadMapEvent:
        
        if (strcharinfo (3) == "vip_room" &&! Vip_status (1) && getgmlevel () == 0) {
            warp "SavePoint", 0,0;
        }
        
}


Vip_room mapflag loadevent

Dessa forma, funciona, mas apenas quando carrega um mapa, mas se o vip expirar dentro do mapa, ele pode permanecer lá até você sair

Como eu conseguiria sua idéia desse script?

-	script	kickmap_vip	-1,{
OnInit:
	.Time = 5;
	while( 1 ){
		if (strcharinfo (3) == "vip_room" &&! Vip_status (1) && getgmlevel () == 0) { 
			warp "SavePoint", 0,0; 
		}
		sleep ( .Time * 60000 );
	}
	end;
}

 

  • 0
Posted
4 minutes ago, M4karov said:

-	script	kickmap_vip	-1,{
OnInit:
	.Time = 5;
	while( 1 ){
		if (strcharinfo (3) == "vip_room" &&! Vip_status (1) && getgmlevel () == 0) { 
			warp "SavePoint", 0,0; 
		}
		sleep ( .Time * 60000 );
	}
	end;
}

 

Console Errro: buildin_strcharinfo fatal error! player not attached!


 
  • 0
Posted
1 hour ago, Puera said:

Console Errro: buildin_strcharinfo fatal error! player not attached!



 

Sorry.

 

-	script	kickmap_vip	-1,{
	
	OnInit:
		.map$ = "prontera";
		.interval = 5;
		
		setmapflag .map$, mf_loadevent;
		end;
		
	OnPCLoadMapEvent:
		if (strcharinfo(3) == .map$) {
			if (!vip_status(VIP_STATUS_ACTIVE) ) {
				warp "SavePoint",0,0;
			}
			else {
				addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent";
			}
		}
		end;
}

 

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...