Raised This Month: $ Target: $400
 0% 

Call something on map change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ramirez
Member
Join Date: Aug 2004
Old 10-15-2006 , 20:03   Call something on map change
Reply With Quote #1

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.
Ramirez is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 10-15-2006 , 20:13   Re: Call something on map change
Reply With Quote #2

public plugin_end() {}
called before mapchange therefor wont be called again when you join
[ --<-@ ] Black Rose is offline
Ramirez
Member
Join Date: Aug 2004
Old 10-15-2006 , 21:08   Re: Call something on map change
Reply With Quote #3

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?
Ramirez is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-15-2006 , 22:26   Re: Call something on map change
Reply With Quote #4

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
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 10-15-2006 , 22:28   Re: Call something on map change
Reply With Quote #5

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
[ --<-@ ] Black Rose is offline
Ramirez
Member
Join Date: Aug 2004
Old 10-16-2006 , 01:20   Re: Call something on map change
Reply With Quote #6

Awsome, thanks guys.. That sould do it!

I'll try em tomorrow and give you karma
Ramirez is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-16-2006 , 02:32   Re: Call something on map change
Reply With Quote #7

and there is client_authorized that might do it too
k007 is offline
Send a message via MSN to k007
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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