Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[rezolvat]EDIT ! [Cerere] Imunitate
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
620
IceCreamCandy
[Banned user]
Status: Offline
(since 03-05-2015 20:37)
Joined: 02 Jul 2014
Posts: 844
,
Topics: 115
Location:
Unknown
Reputation:
48.8
Votes
: 83
Posted: 05-02-2015, 12:22:54
| Translate post to:
... (
Click for more languages
)
Nume:
Imunitate [Toata Runda]
Descriere plugin:
Pot sa o cumpere numai oamenii,costa 60 de credite si cu ea nu mai poti fi infectat.
Alte detalii:
Sa scrie pe ecran cand o cumpara cineva: X are Imunitate !! ,unde x inseamna numele celui care a cumparat.
Exemplu:
-
P.S:
Folosesc Zombie Plague Advance 1.6.1 .
EDIT:
Uitati Sma
Spoiler:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <zombieplague>
#define AUTHOR "Javivi & sunx"
// Bitsums
#define HaveImmunity(%1) g_HaveImmunity & (1<<(%1 & 31))
#define SetHaveImmunity(%1) g_HaveImmunity |= (1<<(%1 & 31))
#define ClearHaveImmunity(%1) g_HaveImmunity &= ~(1<<(%1 & 31))
// If you want immunity for all round, uncomment this !
//#define ALLROUND
// Task IDs
#define TASK_AURA 321
// Ammo Pack cost
#if !defined ALLROUND
new const ITEM_COST = 50
#else
new const ITEM_COST = 50
#endif
// Variables
new g_itemID, g_HudSync, g_SayText, g_HaveImmunity
// Cvars
#if !defined ALLROUND
new cvar_duration
#endif
new cvar_auracolor, cvar_aurasize
// Array
new /*g_HaveImmunity[33],*/ Time[33]
public plugin_init()
{
// Plugin register
register_plugin("[ZP] Extra Item: Immunity", "3.0", AUTHOR)
// Cvars
#if !defined ALLROUND
cvar_duration = register_cvar("zp_immunity_duration", "180")
#endif
cvar_auracolor = register_cvar("zp_immunity_color", "10 200 200")
cvar_aurasize = register_cvar("zp_immunity_aura_size", "15")
// Variables
#if !defined ALLROUND
g_itemID = zp_register_extra_item("Immunitate (toata runda)", ITEM_COST , ZP_TEAM_HUMAN)
#endif
g_HudSync = CreateHudSyncObj()
g_SayText = get_user_msgid("SayText")
// Language File
register_dictionary("zp_extra_immunity.txt")
// Hamsandwich forward
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
// Gamemonitor info
static szCvar[30]
formatex(szCvar, charsmax(szCvar), "v3.0 by Javivi")
register_cvar("zp_immunity", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}
// If some one buy the item
public zp_extra_item_selected(id, itemid)
{
if(itemid == g_itemID)
{
// Wait until the round start
if (!zp_has_round_started())
{
new Temp[32]
formatex(Temp, 31 , "!g[ZP] !y%L", id, "WAIT")
chat_color(id, Temp)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ITEM_COST)
return
}
// If the player already have immunity
if(HaveImmunity(id))
{
new Temp[32]
formatex(Temp, 31, "!g[ZP] !y%L", id, "ALREADY")
chat_color(id, Temp)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ITEM_COST)
return
}
// If the player dont have immunity
else
{
// Enable Godmode
set_user_godmode(id, 1)
// Aura task
set_task(0.1, "aura", id + TASK_AURA, _, _, "b")
SetHaveImmunity(id)
// If you want use the item all round
#if defined ALLROUND
set_hudmessage(85, 127, 255, -1.0, 0.15, 1, 0.1, 3.0, 0.05, 0.05, -1)
ShowSyncHudMsg(id, g_HudSync, "%L", id, "IMMUME")
#else
// Start the countdown !
Time[id] = get_pcvar_num(cvar_duration)
CountDown(id)
#endif
}
}
}
// Countdown code
public CountDown(id)
{
// If time is 0 or -1
if(Time[id] <= 0)
{
// Remove aura task
remove_task(id + TASK_AURA)
// Client_Print
client_print(id, print_center, "%L", id, "EXPIRED")
// Disable godmode
set_user_godmode(id, 0)
// Remove immunity
ClearHaveImmunity(id)
// Remove countdown
return
}
// Time - 1
Time[id]--
// Show the immunity seconds
set_hudmessage(85, 127, 255, -1.0, 0.15, 1, 0.1, 3.0, 0.05, 0.05, -1)
ShowSyncHudMsg(id, g_HudSync, "%L", id, "REMAINING", Time[id])
// Repeat
set_task(1.0, "CountDown", id)
}
// If user is infected (Infection nade)
public zp_user_infected_post(id)
{
if(HaveImmunity(id))
{
#if !defined ALLROUND
// Remove countdown task
Time[id] = 0
#endif
// Remove aura task
remove_task(id + TASK_AURA)
// Remove immunity
ClearHaveImmunity(id)
// Disable godmode
set_user_godmode(id, 0)
}
}
// At player spawn
public fw_PlayerSpawn_Post(id)
{
if(HaveImmunity(id))
{
#if !defined ALLROUND
// Remove countdown task
Time[id] = 0
#else
// If allround is uncommented show a message.
client_print(id, print_center, "%L", id, "EXPIRED")
#endif
// Remove aura task
remove_task(id + TASK_AURA)
// Disable godmode
set_user_godmode(id, 0)
// Remove immunity
ClearHaveImmunity(id)
}
}
/*============
Aura Code
============*/
public aura(id)
{
id -= TASK_AURA
// If user die
if (!is_user_alive(id))
return
// Color cvar ---> RGB!
new szColors[16]
get_pcvar_string(cvar_auracolor, szColors, 15)
new gRed[4], gGreen[4], gBlue[4], iRed, iGreen, iBlue
parse(szColors, gRed, 3, gGreen, 3, gBlue, 3)
iRed = clamp(str_to_num(gRed), 0, 255)
iGreen = clamp(str_to_num(gGreen), 0, 255)
iBlue = clamp(str_to_num(gBlue), 0, 255)
new Origin[3]
get_user_origin(id, Origin)
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_DLIGHT)
write_coord(Origin[0])
write_coord(Origin[1])
write_coord(Origin[2])
write_byte(get_pcvar_num(cvar_aurasize))
write_byte(iRed) // R
write_byte(iGreen) // G
write_byte(iBlue) // B
write_byte(2)
write_byte(0)
message_end()
}
/*===============
ColorChat Stock
===============*/
stock chat_color(const id, const input[], any:...)
{
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
write_byte(id)
write_string(msg)
message_end()
}
Asta dureaza 180 sec.
Bagati sa tina toata runda si sa apara pe ecran cand cumpara cineva imunitate.
0
0
Back to top
XStreamer
[Volcanic Aurum]
Status: Offline
(since 26-02-2024 11:50)
Joined: 04 Nov 2012
Posts: 1559
,
Topics: 103
Location:
Romania
Reputation:
590.2
Votes
: 36
Posted: 05-02-2015, 16:20:36
| Translate post to:
... (
Click for more languages
)
Ia vezi acum ( trebuiau scoase " // " de la #define ALLROUND )
Spoiler:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <zombieplague>
#define AUTHOR "Javivi & sunx"
// Bitsums
#define HaveImmunity(%1) g_HaveImmunity & (1<<(%1 & 31))
#define SetHaveImmunity(%1) g_HaveImmunity |= (1<<(%1 & 31))
#define ClearHaveImmunity(%1) g_HaveImmunity &= ~(1<<(%1 & 31))
// If you want immunity for all round, uncomment this !
#define ALLROUND
// Task IDs
#define TASK_AURA 321
// Ammo Pack cost
#if !defined ALLROUND
new const ITEM_COST = 50
#else
new const ITEM_COST = 50
#endif
// Variables
new g_itemID, g_HudSync, g_SayText, g_HaveImmunity
// Cvars
#if !defined ALLROUND
new cvar_duration
#endif
new cvar_auracolor, cvar_aurasize
// Array
new /*g_HaveImmunity[33],*/ Time[33]
public plugin_init()
{
// Plugin register
register_plugin("[ZP] Extra Item: Immunity", "3.0", AUTHOR)
// Cvars
#if !defined ALLROUND
cvar_duration = register_cvar("zp_immunity_duration", "180")
#endif
cvar_auracolor = register_cvar("zp_immunity_color", "10 200 200")
cvar_aurasize = register_cvar("zp_immunity_aura_size", "15")
// Variables
#if !defined ALLROUND
g_itemID = zp_register_extra_item("Immunitate (toata runda)", ITEM_COST , ZP_TEAM_HUMAN)
#endif
g_HudSync = CreateHudSyncObj()
g_SayText = get_user_msgid("SayText")
// Language File
register_dictionary("zp_extra_immunity.txt")
// Hamsandwich forward
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
// Gamemonitor info
static szCvar[30]
formatex(szCvar, charsmax(szCvar), "v3.0 by Javivi")
register_cvar("zp_immunity", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
}
// If some one buy the item
public zp_extra_item_selected(id, itemid)
{
if(itemid == g_itemID)
{
// Wait until the round start
if (!zp_has_round_started())
{
new Temp[32]
formatex(Temp, 31 , "!g[ZP] !y%L", id, "WAIT")
chat_color(id, Temp)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ITEM_COST)
return
}
// If the player already have immunity
if(HaveImmunity(id))
{
new Temp[32]
formatex(Temp, 31, "!g[ZP] !y%L", id, "ALREADY")
chat_color(id, Temp)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ITEM_COST)
return
}
// If the player dont have immunity
else
{
// Enable Godmode
set_user_godmode(id, 1)
// Aura task
set_task(0.1, "aura", id + TASK_AURA, _, _, "b")
SetHaveImmunity(id)
// If you want use the item all round
#if defined ALLROUND
set_hudmessage(85, 127, 255, -1.0, 0.15, 1, 0.1, 3.0, 0.05, 0.05, -1)
ShowSyncHudMsg(id, g_HudSync, "%L", id, "IMMUME")
#else
// Start the countdown !
Time[id] = get_pcvar_num(cvar_duration)
CountDown(id)
#endif
}
}
}
// Countdown code
public CountDown(id)
{
// If time is 0 or -1
if(Time[id] <= 0)
{
// Remove aura task
remove_task(id + TASK_AURA)
// Client_Print
client_print(id, print_center, "%L", id, "EXPIRED")
// Disable godmode
set_user_godmode(id, 0)
// Remove immunity
ClearHaveImmunity(id)
// Remove countdown
return
}
// Time - 1
Time[id]--
// Show the immunity seconds
set_hudmessage(85, 127, 255, -1.0, 0.15, 1, 0.1, 3.0, 0.05, 0.05, -1)
ShowSyncHudMsg(id, g_HudSync, "%L", id, "REMAINING", Time[id])
// Repeat
set_task(1.0, "CountDown", id)
}
// If user is infected (Infection nade)
public zp_user_infected_post(id)
{
if(HaveImmunity(id))
{
#if !defined ALLROUND
// Remove countdown task
Time[id] = 0
#endif
// Remove aura task
remove_task(id + TASK_AURA)
// Remove immunity
ClearHaveImmunity(id)
// Disable godmode
set_user_godmode(id, 0)
}
}
// At player spawn
public fw_PlayerSpawn_Post(id)
{
if(HaveImmunity(id))
{
#if !defined ALLROUND
// Remove countdown task
Time[id] = 0
#else
// If allround is uncommented show a message.
client_print(id, print_center, "%L", id, "EXPIRED")
#endif
// Remove aura task
remove_task(id + TASK_AURA)
// Disable godmode
set_user_godmode(id, 0)
// Remove immunity
ClearHaveImmunity(id)
}
}
/*============
Aura Code
============*/
public aura(id)
{
id -= TASK_AURA
// If user die
if (!is_user_alive(id))
return
// Color cvar ---> RGB!
new szColors[16]
get_pcvar_string(cvar_auracolor, szColors, 15)
new gRed[4], gGreen[4], gBlue[4], iRed, iGreen, iBlue
parse(szColors, gRed, 3, gGreen, 3, gBlue, 3)
iRed = clamp(str_to_num(gRed), 0, 255)
iGreen = clamp(str_to_num(gGreen), 0, 255)
iBlue = clamp(str_to_num(gBlue), 0, 255)
new Origin[3]
get_user_origin(id, Origin)
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_DLIGHT)
write_coord(Origin[0])
write_coord(Origin[1])
write_coord(Origin[2])
write_byte(get_pcvar_num(cvar_aurasize))
write_byte(iRed) // R
write_byte(iGreen) // G
write_byte(iBlue) // B
write_byte(2)
write_byte(0)
message_end()
}
/*===============
ColorChat Stock
===============*/
stock chat_color(const id, const input[], any:...)
{
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
write_byte(id)
write_string(msg)
message_end()
}
0
0
Back to top
IceCreamCandy
[Banned user]
Status: Offline
(since 03-05-2015 20:37)
Joined: 02 Jul 2014
Posts: 844
,
Topics: 115
Location:
Unknown
Reputation:
48.8
Votes
: 83
Posted: 05-02-2015, 18:04:07
| Translate post to:
... (
Click for more languages
)
Asa e.
Nu stiu cum de nu le-am vazut.
Puteti inchide acest topic.
 
Staff message
(
AMG
):
Mãgãrii cu reputaþia + multicont
https://www.freakz.ro/forum/Dualitatea-pe-forum-t240707.html
+3 warn-uri
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
-P!C@-
, 05 February 2015 17:00
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 29-07-2025, 00:20:26
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details