Raised This Month: $51 Target: $400
 12% 

Plugin Requst ZE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 12-27-2021 , 09:41   Plugin Requst ZE
Reply With Quote #1

Hi
I need extra limit plugin for mod zp 4.3
QuickDroLLL is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-27-2021 , 14:42   Re: Plugin Requst ZE
Reply With Quote #2

Extra limit meaning?...
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 12-28-2021 , 11:56   Re: Plugin Requst ZE
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Extra limit meaning?...
can you fix this ?

#include <amxmodx>
#include <amx_settings_api>
#include <zombie_escape>

#if ZPS_INC_VERSION < 44
#assert Zombie zombie_escape
#endif

// Extra Itens file
new const ZP_EXTRAITEMS_FILE[] = "zpsp_extraitems.ini"

#define NO_LIMIT 0

// Index of Custom Extra item
#define ITEM_INDEX itemid-g_start

new Array:g_ItemLimit, Array:g_MapItemLimit, Array:g_ItemLimitCount, Array:g_MapItemLimitCount, g_start, g_count, g_maxplayers
new Array:g_PlayerItemLimit, Array:g_PlayerMapItemLimit, Array:g_PlayerLimitCount[33], Array:g_MapPlayerLimitCount[33]

public plugin_init()
{
register_plugin("[ZPSp] Item Limiter", "1.1", "WiLS | [P]erfect [S]crash")

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")

g_ItemLimit = ArrayCreate(1, 1)
g_MapItemLimit = ArrayCreate(1, 1)
g_ItemLimitCount = ArrayCreate(1, 1)
g_MapItemLimitCount = ArrayCreate(1, 1)
g_PlayerItemLimit = ArrayCreate(1, 1)
g_PlayerMapItemLimit = ArrayCreate(1, 1)

g_maxplayers = get_maxplayers()

for(new i = 1; i <= g_maxplayers; i++) {
g_PlayerLimitCount[i] = ArrayCreate(1, 1)
g_MapPlayerLimitCount[i] = ArrayCreate(1, 1)
}

set_task(1.0, "load_save_limiter")
}

public load_save_limiter()
{
new index, real_name[128], limit, i

g_start = zp_get_custom_extra_start()
g_count = zp_get_extra_item_count()

for (index = g_start; index < g_count; index++) {
zp_get_extra_item_realname(index, real_name, charsmax(real_name))

limit = NO_LIMIT
if (!amx_load_setting_int(ZP_EXTRAITEMS_FILE, real_name, "LIMIT PER ROUND", limit))
amx_save_setting_int(ZP_EXTRAITEMS_FILE, real_name, "LIMIT PER ROUND", limit)

ArrayPushCell(g_ItemLimit, limit)

limit = NO_LIMIT;
if (!amx_load_setting_int(ZP_EXTRAITEMS_FILE, real_name, "LIMIT PER MAP", limit))
amx_save_setting_int(ZP_EXTRAITEMS_FILE, real_name, "LIMIT PER MAP", limit)

ArrayPushCell(g_MapItemLimit, limit)

limit = NO_LIMIT;
if (!amx_load_setting_int(ZP_EXTRAITEMS_FILE, real_name, "PLAYER LIMIT PER ROUND", limit))
amx_save_setting_int(ZP_EXTRAITEMS_FILE, real_name, "PLAYER LIMIT PER ROUND", limit)

ArrayPushCell(g_PlayerItemLimit, limit)

limit = NO_LIMIT;
if (!amx_load_setting_int(ZP_EXTRAITEMS_FILE, real_name, "PLAYER LIMIT PER MAP", limit))
amx_save_setting_int(ZP_EXTRAITEMS_FILE, real_name, "PLAYER LIMIT PER MAP", limit)

ArrayPushCell(g_PlayerMapItemLimit, limit)

ArrayPushCell(g_ItemLimitCount, 0)
ArrayPushCell(g_MapItemLimitCount, 0)

for(i = 1; i <= g_maxplayers; i++) {
ArrayPushCell(g_PlayerLimitCount[i], 0)
ArrayPushCell(g_MapPlayerLimitCount[i], 0)
}
}
}

public event_round_start()
{
// Reset Round Limit Count
static i, item
for(i = 0; i < ArraySize(g_ItemLimitCount); i++)
ArraySetCell(g_ItemLimitCount, i, 0)

for(i = 1; i <= g_maxplayers; i++) {
for(item = 0; item < ArraySize(g_ItemLimitCount); item++)
ArraySetCell(g_PlayerLimitCount[i], item, 0)
}
}

public zp_extra_item_selected(id, itemid)
{
if(itemid < g_start)
return;

if(ArrayGetCell(g_ItemLimit, ITEM_INDEX) != NO_LIMIT)
ArraySetCell(g_ItemLimitCount, ITEM_INDEX, ArrayGetCell(g_ItemLimitCount, ITEM_INDEX) + 1)

if(ArrayGetCell(g_MapItemLimit, ITEM_INDEX) != NO_LIMIT)
ArraySetCell(g_MapItemLimitCount, ITEM_INDEX, ArrayGetCell(g_MapItemLimitCount, ITEM_INDEX) + 1)

if(ArrayGetCell(g_PlayerItemLimit, ITEM_INDEX) != NO_LIMIT)
ArraySetCell(g_PlayerLimitCount[id], ITEM_INDEX, ArrayGetCell(g_PlayerLimitCount[id], ITEM_INDEX)+1)

if(ArrayGetCell(g_PlayerMapItemLimit, ITEM_INDEX) != NO_LIMIT)
ArraySetCell(g_MapPlayerLimitCount[id], ITEM_INDEX, ArrayGetCell(g_MapPlayerLimitCount[id], ITEM_INDEX)+1)

}

public zp_extra_item_selected_pre(id, itemid)
{
if(itemid < g_start)
return PLUGIN_CONTINUE;

static current, current_map, limit, map_limit
static pl_current, pl_current_map, pl_limit, pl_map_limit

pl_current = ArrayGetCell(g_PlayerLimitCount[id], ITEM_INDEX)
pl_current_map = ArrayGetCell(g_MapPlayerLimitCount[id], ITEM_INDEX)

current = ArrayGetCell(g_ItemLimitCount, ITEM_INDEX)
current_map = ArrayGetCell(g_MapItemLimitCount, ITEM_INDEX)

limit = ArrayGetCell(g_ItemLimit, ITEM_INDEX)
map_limit = ArrayGetCell(g_MapItemLimit, ITEM_INDEX)

pl_limit = ArrayGetCell(g_PlayerItemLimit, ITEM_INDEX)
pl_map_limit = ArrayGetCell(g_PlayerMapItemLimit, ITEM_INDEX)

static text[200]
text[0] = 0

// Per Player
if (pl_limit != NO_LIMIT)
format(text, charsmax(text), "\y[%d/%d] ", pl_current, pl_limit)

if (pl_map_limit != NO_LIMIT)
format(text, charsmax(text), "%s\y[%d/%d] ", text, pl_current_map, pl_map_limit)

// Global
if (limit != NO_LIMIT)
format(text, charsmax(text), "%s\r[%d/%d] ", text, current, limit)

if (map_limit != NO_LIMIT)
format(text, charsmax(text), "%s\r[%d/%d]", text, current_map, map_limit)

if(text[0])
zp_extra_item_textadd(text)

if (limit != NO_LIMIT && current >= limit || map_limit != NO_LIMIT && current_map >= map_limit
|| pl_limit != NO_LIMIT && pl_current >= pl_limit || pl_map_limit != NO_LIMIT && pl_current_map >= pl_map_limit)
return ZP_PLUGIN_HANDLED;

return PLUGIN_CONTINUE;
}

Last edited by QuickDroLLL; 12-28-2021 at 11:58.
QuickDroLLL is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 12-28-2021 , 22:32   Re: Plugin Requst ZE
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=242103

So basically convert this to zp 4.3
__________________
My plugin:
Celena Luna is offline
QuickDroLLL
Senior Member
Join Date: Dec 2021
Location: AMX Mod X Land
Old 03-19-2022 , 17:05   Re: Plugin Requst ZE
Reply With Quote #5

Quote:
Originally Posted by Celena Luna View Post
https://forums.alliedmods.net/showthread.php?t=242103

So basically convert this to zp 4.3
can do it
bcz i don't know how
QuickDroLLL 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 03:03.


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