AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making a new zone (https://forums.alliedmods.net/showthread.php?t=106752)

KadiR 10-18-2009 11:37

Making a new zone
 
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 :wink:

grimvh2 10-18-2009 11:43

Re: Making a new zone
 
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;



KadiR 10-18-2009 12:32

Re: Making a new zone
 
thanks, and how can I add if the player was in the zone + delay ?

ot_207 10-18-2009 12:35

Re: Making a new zone
 
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.

grimvh2 10-18-2009 12:41

Re: Making a new zone
 
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;



ot_207 10-18-2009 12:47

Re: Making a new zone
 
Better a think time man. :wink:

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



grimvh2 10-18-2009 13:25

Re: Making a new zone
 
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.

tpt 10-18-2009 16:37

Re: Making a new zone
 
Quote:

Originally Posted by grimvh2 (Post 966184)
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. :)

drumzplaya13 10-19-2009 06:29

Re: Making a new zone
 
or a surf map which is meant to be completed as a course.

grimvh2 10-19-2009 11:45

Re: Making a new zone
 
Well its still the same type


All times are GMT -4. The time now is 22:32.

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