AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Call something on map change (https://forums.alliedmods.net/showthread.php?t=45985)

Ramirez 10-15-2006 20:03

Call something on map change
 
Hi, I haven't been scripting in some months so I kinda forgot lots of stuff...
I was recently trying something new.

Basically I wanted to make every one in the server "retry" when a mapchanger occurs...

I couldn't find anything to work tho...

Best thing I've found so far was client_connect()

But for example...

Code:

public client_connect(id) {
    client_cmd(id,"retry")
}

Will just make you retry for an infinite amount ... I just want my plugin to make people retry once then connect on the server.

What is the best way to do that? If it's even possible.

[ --<-@ ] Black Rose 10-15-2006 20:13

Re: Call something on map change
 
public plugin_end() {}
called before mapchange therefor wont be called again when you join

Ramirez 10-15-2006 21:08

Re: Call something on map change
 
Oooh , thanks.

THat might do it..

But I was kinda looking for a way to make a client connect twice in map changes...
Like, 2 connections instead of 1... really not sure if that's possible..

Using plugin_end would just make it connect once right?
Unless I put a timer?

Emp` 10-15-2006 22:26

Re: Call something on map change
 
might be able to do soemthing like this too
Code:

public plugin_init(){
    //stuffz..
    set_task(1.0,"reconnect_players")
}
public reconnect_players()
{
    //then find players and reconnect them here
}

that should work also i think

[ --<-@ ] Black Rose 10-15-2006 22:28

Re: Call something on map change
 
try
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("", "", "")         set_task(5.0, "stop_retry") } new bool:g_retry public client_connect(id) {     if ( g_retry )         client_cmd(id,"retry") } public stop_retry()     g_retry = false

Ramirez 10-16-2006 01:20

Re: Call something on map change
 
Awsome, thanks guys.. That sould do it!

I'll try em tomorrow and give you karma :D

k007 10-16-2006 02:32

Re: Call something on map change
 
and there is client_authorized that might do it too


All times are GMT -4. The time now is 04:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.