Raised This Month: $ Target: $400
 0% 

Making a new zone


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-18-2009 , 11:37   Making a new zone
Reply With Quote #1

I want to makes zones like this plugin:

http://forums.alliedmods.net/showthread.php?p=667563

That should be the function:

If player touches the zone, it will save on the server somewhere (like stats) that he finished the map!
There should be a delay for touching the zone again (def=120min)

I don't really know how make this function, I hope, that some one can help me
KadiR is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-18-2009 , 11:43   Re: Making a new zone
Reply With Quote #2

PHP Code:
public fwd_FM_CmdStart_pre(iduc_handle)
{        
    for(new 
ii<g_iZonesNumi++)
    {
        if( 
is_user_in_zone(idi) )
        {
            
/* User is in zone */
        
}
    }
    return 
FMRES_IGNORED;

__________________
I am out of order!
grimvh2 is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-18-2009 , 12:32   Re: Making a new zone
Reply With Quote #3

thanks, and how can I add if the player was in the zone + delay ?
KadiR is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-18-2009 , 12:35   Re: Making a new zone
Reply With Quote #4

After he has left the zone.
Set a float variable where you place the time that has passed from last touch.
When > x do what you want to do.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-18-2009 , 12:41   Re: Making a new zone
Reply With Quote #5

PHP Code:
new allow[33]
new 
delay

// In plugin init
delay register_cvar("amx_timedelay""120"// in seconds 

// at your cmd when you start the map
set_task(get_pcvar_float(delay), "timecheck",id)

public 
timecheck(id)
    
allow[id]++

public 
fwd_FM_CmdStart_pre(iduc_handle)
{        
    for(new 
ii<g_iZonesNumi++)
    {
        if( 
is_user_in_zone(idi) && allow[id])
        {
            
/* User is in zone */
        
}
    }
    return 
FMRES_IGNORED;

__________________
I am out of order!
grimvh2 is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-18-2009 , 12:47   Re: Making a new zone
Reply With Quote #6

Better a think time man.

PHP Code:
new gf_timeafterGotOut[33]

// When gets out
gf_timeafterGotOut[id] = get_gametime() // the moment when the player got out

public Client_PreThink(id)
{
  
// Not interested whether he entered the zone
  
if (gf_timeafterGotOut[id] == 0.0)
   return 
PLUGIN_CONTINUE
 
  
new gametime get_gametime()
  if (
float(floatround(gametime)) - 0.05 <= gf_timeafterGotOut[id] - gametime <= float(floatround(gametime)) + 0.05)
  {
    
client_print(idprint_chat"%d seconds have passed from getting out of the zone"floatroundgf_timeafterGotOut[id] - gametime ))
  }

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-18-2009 , 13:25   Re: Making a new zone
Reply With Quote #7

As far as I understand his post,
hes talking about kreedz, and once he activated the start button or start cmd or w/e. You have to wait 120 seconds before you can come in the zone.
__________________
I am out of order!
grimvh2 is offline
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 10-18-2009 , 16:37   Re: Making a new zone
Reply With Quote #8

Quote:
Originally Posted by grimvh2 View Post
As far as I understand his post,
hes talking about kreedz, and once he activated the start button or start cmd or w/e. You have to wait 120 seconds before you can come in the zone.
It could be for deathrun also.
tpt is offline
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 10-19-2009 , 06:29   Re: Making a new zone
Reply With Quote #9

or a surf map which is meant to be completed as a course.
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-19-2009 , 11:45   Re: Making a new zone
Reply With Quote #10

Well its still the same type
__________________
I am out of order!
grimvh2 is offline
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 22:32.


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