Raised This Month: $32 Target: $400
 8% 

[Any] Dev Zones (Zones Manager with natives for developers) [Updated 30-Mar-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 03-15-2019 , 11:45   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #161

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <devzones>
// configuration
#define ZONE_PREFIX "rushyasak"
//End
new Float:zone_pos[MAXPLAYERS+1][3];
new 
Handle:g_hClientTimers[MAXPLAYERS 1] = {INVALID_HANDLE, ...};
public 
Plugin:myinfo =
{
    
name "SM DEV Zones - NoEntry",
    
author "Franc1sco franug",
    
description "",
    
version "2.0",
    
url "http://steamcommunity.com/id/franug"
};

public 
OnClientDisconnect(client)
{
    if (
g_hClientTimers[client] != INVALID_HANDLE)
        
KillTimer(g_hClientTimers[client]);
    
g_hClientTimers[client] = INVALID_HANDLE;
}

public 
Zone_OnClientEntry(client, const char[] zone)
{
    if(
client || client MaxClients || !IsClientInGame(client) ||!IsPlayerAlive(client))
    return;
    if(
StrContains(zoneZONE_PREFIXfalse) == 0)
    {
        
Zone_GetZonePosition(zonefalsezone_pos[client]);
        
g_hClientTimers[client] = CreateTimer(0.1Timer_RepeatclientTIMER_REPEAT);
        
PrintToChat(client"[SM] \x04 You can't enter here!");
    }
}

public 
Zone_OnClientLeave(client, const char[] zone)
{
    if(
client || client MaxClients || !IsClientInGame(client) ||!IsPlayerAlive(client)) 
        return;
    if(
StrContains(zoneZONE_PREFIXfalse) == 0)
    {
        if (
g_hClientTimers[client] != INVALID_HANDLE)
        
KillTimer(g_hClientTimers[client]);
        
g_hClientTimers[client] = INVALID_HANDLE;
    }
}

public 
Action:Timer_Repeat(Handle:timerany:client)
{
    new 
iTeam1Count GetTeamClientCountAlive(2);
    new 
iTeam2Count GetTeamClientCountAlive(3);
    if(!
IsClientInGame(client) || !IsPlayerAlive(client) || iTeam1Count == || iTeam2Count == 1)
    {
        if (
g_hClientTimers[client] != INVALID_HANDLE)
        
KillTimer(g_hClientTimers[client]);
        
g_hClientTimers[client] = INVALID_HANDLE;
        return 
Plugin_Stop;
    }
    new 
Float:clientloc[3];
    
GetClientAbsOrigin(clientclientloc);
    
KnockbackSetVelocity(clientzone_pos[client], clientloc300.0);
    return 
Plugin_Continue;
}

KnockbackSetVelocity(client, const Float:startpoint[3], const Float:endpoint[3], Float:magnitude)
{
    
// Create vector from the given starting and ending points.
    
new Float:vector[3];
    
MakeVectorFromPoints(startpointendpointvector);
    
// Normalize the vector (equal magnitude at varying distances).
    
NormalizeVector(vectorvector);
    
// Apply the magnitude by scaling the vector (multiplying each of its components).
    
ScaleVector(vectormagnitude);
    
TeleportEntity(clientNULL_VECTORNULL_VECTORvector);
}

stock GetTeamClientCountAlive(team)
{
    new 
iCount 0;
    for(new 
client=1;client<=MaxClients;client++)
    {
        if(
IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == team)
        {
            
iCount++;
        }
    }
    return 
iCount;

I tried to add the new syntax to this module. If 1 player remains on the team, the plugin will stop.
Do you see the problem with the codes?
__________________

Last edited by alphaearth; 03-15-2019 at 11:47.
alphaearth is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 03-15-2019 , 12:11   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #162

Quote:
Originally Posted by alphaearth View Post
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <devzones>
// configuration
#define ZONE_PREFIX "rushyasak"
//End
new Float:zone_pos[MAXPLAYERS+1][3];
new 
Handle:g_hClientTimers[MAXPLAYERS 1] = {INVALID_HANDLE, ...};
public 
Plugin:myinfo =
{
    
name "SM DEV Zones - NoEntry",
    
author "Franc1sco franug",
    
description "",
    
version "2.0",
    
url "http://steamcommunity.com/id/franug"
};

public 
OnClientDisconnect(client)
{
    if (
g_hClientTimers[client] != INVALID_HANDLE)
        
KillTimer(g_hClientTimers[client]);
    
g_hClientTimers[client] = INVALID_HANDLE;
}

public 
Zone_OnClientEntry(client, const char[] zone)
{
    if(
client || client MaxClients || !IsClientInGame(client) ||!IsPlayerAlive(client))
    return;
    if(
StrContains(zoneZONE_PREFIXfalse) == 0)
    {
        
Zone_GetZonePosition(zonefalsezone_pos[client]);
        
g_hClientTimers[client] = CreateTimer(0.1Timer_RepeatclientTIMER_REPEAT);
        
PrintToChat(client"[SM] \x04 You can't enter here!");
    }
}

public 
Zone_OnClientLeave(client, const char[] zone)
{
    if(
client || client MaxClients || !IsClientInGame(client) ||!IsPlayerAlive(client)) 
        return;
    if(
StrContains(zoneZONE_PREFIXfalse) == 0)
    {
        if (
g_hClientTimers[client] != INVALID_HANDLE)
        
KillTimer(g_hClientTimers[client]);
        
g_hClientTimers[client] = INVALID_HANDLE;
    }
}

public 
Action:Timer_Repeat(Handle:timerany:client)
{
    new 
iTeam1Count GetTeamClientCountAlive(2);
    new 
iTeam2Count GetTeamClientCountAlive(3);
    if(!
IsClientInGame(client) || !IsPlayerAlive(client) || iTeam1Count == || iTeam2Count == 1)
    {
        if (
g_hClientTimers[client] != INVALID_HANDLE)
        
KillTimer(g_hClientTimers[client]);
        
g_hClientTimers[client] = INVALID_HANDLE;
        return 
Plugin_Stop;
    }
    new 
Float:clientloc[3];
    
GetClientAbsOrigin(clientclientloc);
    
KnockbackSetVelocity(clientzone_pos[client], clientloc300.0);
    return 
Plugin_Continue;
}

KnockbackSetVelocity(client, const Float:startpoint[3], const Float:endpoint[3], Float:magnitude)
{
    
// Create vector from the given starting and ending points.
    
new Float:vector[3];
    
MakeVectorFromPoints(startpointendpointvector);
    
// Normalize the vector (equal magnitude at varying distances).
    
NormalizeVector(vectorvector);
    
// Apply the magnitude by scaling the vector (multiplying each of its components).
    
ScaleVector(vectormagnitude);
    
TeleportEntity(clientNULL_VECTORNULL_VECTORvector);
}

stock GetTeamClientCountAlive(team)
{
    new 
iCount 0;
    for(new 
client=1;client<=MaxClients;client++)
    {
        if(
IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == team)
        {
            
iCount++;
        }
    }
    return 
iCount;

I tried to add the new syntax to this module. If 1 player remains on the team, the plugin will stop.
Do you see the problem with the codes?
new iTeam1Count = GetTeamClientCountAlive(2);
new iTeam2Count = GetTeamClientCountAlive(3);
if(!IsClientInGame(client) || !IsPlayerAlive(client) || iTeam1Count == 1 || iTeam2Count == 1)
__________________
8guawong is offline
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 03-15-2019 , 13:06   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #163

How can I fix the error? Can you help?

Code:
public Action:Timer_Repeat(Handle:timer, any:client)
{
	new iTeam1Count = GetTeamClientCountAlive(2);
	new iTeam2Count = GetTeamClientCountAlive(3);
	if(iTeam1Count == 1 || iTeam2Count == 1)
	{
		if (g_hClientTimers[client] != INVALID_HANDLE)
		KillTimer(g_hClientTimers[client]);
		g_hClientTimers[client] = INVALID_HANDLE;
		return Plugin_Stop;
	}
	new Float:clientloc[3];
	GetClientAbsOrigin(client, clientloc);
	KnockbackSetVelocity(client, zone_pos[client], clientloc, 300.0);
	return Plugin_Continue;
}
stock GetTeamClientCountAlive(team)
{
	new iCount = 0;
	for(new client=1;client<=MaxClients;client++)
	{
		if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == team)
		{
			iCount++;
		}
	}
	return iCount;
}
__________________

Last edited by alphaearth; 03-15-2019 at 13:10.
alphaearth is offline
napster_10
Senior Member
Join Date: May 2016
Old 07-28-2019 , 08:22   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #164

not working properly..needs fixes! people getting punished with the anticamp plugin sometimes even when they are not in the zone (far away).

only thing i changed is

PHP Code:
ForcePlayerSuicide(client); 
to

PHP Code:
SlapPlayer(client99); 



in the picture it occurs couple of seconds after spawning (as you can see far away from the zone) but it also happens late in game at random places (behind the tower on the bridge for example - pointed blue arrow in picture)
napster_10 is offline
napster_10
Senior Member
Join Date: May 2016
Old 07-30-2019 , 16:28   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #165

...expected
napster_10 is offline
cancan
Member
Join Date: Jul 2019
Old 08-01-2019 , 20:06   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #166

Hello guys,

When I change map, zones are gone.

What can I do for that?

Thank you.
cancan is offline
napster_10
Senior Member
Join Date: May 2016
Old 09-06-2019 , 08:57   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #167

can someone fix this?..i can pay..pm me!
napster_10 is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 09-17-2019 , 20:15   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #168

This plugin corrupts some config files like de_mirage.zones.txt
When u switch from a map that has no config to a map with a config, it overrides the map with the config so it becomes empty like the previous map.



"Zones"
{
}

Last edited by Ejziponken; 09-17-2019 at 21:04.
Ejziponken is offline
Benito
Member
Join Date: Jul 2018
Location: Belgique - Belgium
Old 10-02-2019 , 09:02   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #169

Quote:
Originally Posted by Ejziponken View Post
This plugin corrupts some config files like de_mirage.zones.txt
When u switch from a map that has no config to a map with a config, it overrides the map with the config so it becomes empty like the previous map.



"Zones"
{
}

did you put the permission 777 to your file of_mirage.zones.txt otherwise the plugin will not be able to open the file
Benito is offline
eNciiik
New Member
Join Date: Oct 2019
Old 10-13-2019 , 11:14   Re: [Any] Dev Zones (with natives for developers)
Reply With Quote #170

Hi,
I need help

I use this plugin https://forums.alliedmods.net/showthread.php?t=283311 on my JailBreak server and I would like to detect when the ball is in a goal, but devzones
Code:
HookSingleEntityOutput(iEnt, "OnStartTouch", EntOut_OnStartTouch);          (Line 197)
Isn't detecting ball as entity, but it is entity.

Last edited by eNciiik; 10-13-2019 at 11:17.
eNciiik is offline
Reply


Thread Tools
Display Modes

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 06:26.


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