Jump to content
  • 0

Kick player out of map after vip expire


Puera

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  07/26/17
  • Last Seen:  

The title self explain ....

 its possible?

 

Thanks

Edited by Puera
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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.  

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  07/26/17
  • Last Seen:  

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.

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

Im not sure of whats the best way to do that,

But as temporary, you can use the ontick/ontimer.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  07/26/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  149
  • Reputation:   36
  • Joined:  04/01/13
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  07/26/17
  • Last Seen:  

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!


 
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  149
  • Reputation:   36
  • Joined:  04/01/13
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites

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.

×
×
  • Create New...