Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[rezolvat]Ajutor plugin lider credite
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
638
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: 03-05-2015, 12:12:47
| Translate post to:
... (
Click for more languages
)
Pluginul asta:
Spoiler:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#define PLUGIN "[ZP] Addon: APs Leader"
#define VERSION "1.2"
#define AUTHOR "IceCreamCandy"
// Cvars
new leader_msj
// Others
new MaxPlayers, SayText
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
// Language Files
register_dictionary("zp_lider_credite.txt")
// Cvars
leader_msj = register_cvar("zp_leader_msj", "1")
/*
zp_leader_msj 0. Plugin Disable.
zp_leader_msj 1. Message at RoundStart.
zp_leader_msj 2. Message when you say or say_team "/leader".
zp_leader_msj 3. Both.
*/
// Client Commands
register_clcmd("say /leader", "CheckLeader")
register_clcmd("say_team /leader", "CheckLeader")
// Event
register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
// Others
SayText = get_user_msgid("SayText")
MaxPlayers = get_maxplayers()
}
public RoundStart()
{
if ( get_pcvar_num(leader_msj) == 1 || get_pcvar_num(leader_msj) == 3 )
set_task(2.2, "Leader") // I use this set_task to the message appears then of "welcome_msg"
}
public Leader()
{
if ( get_pcvar_num(leader_msj) == 1 || get_pcvar_num(leader_msj) == 3 )
{
new iAmmoPacks
new iLeader = GetLeader(iAmmoPacks)
new Players = UsersGetPlaying()
new iPlayers[32], iNum, Others
new szName[32]
get_user_name( iLeader, szName, 31 )
get_players( iPlayers, iNum, "ch" )
for ( new i = 0; i < iNum; i++ )
Others = zp_get_user_ammo_packs(i)
if ( Players == 0 )
ChatColor( 0, "%L", LANG_PLAYER, "NO_PLAYERS" )
else if ( iAmmoPacks == Others )
ChatColor( 0, "%L", LANG_PLAYER, "MORE_LEADERS" )
else
ChatColor( 0, "%L", LANG_PLAYER, "LEADER", szName, iAmmoPacks )
}
}
// Check Leader
public CheckLeader(id)
{
if ( get_pcvar_num(leader_msj) == 2 || get_pcvar_num(leader_msj) == 3 )
{
new iAmmoPacks
new iLeader = GetLeader(iAmmoPacks)
new Players = UsersGetPlaying()
new iPlayers[32], iNum, Others
new szName[32]
get_user_name( iLeader, szName, 31 )
get_players( iPlayers, iNum, "ch" )
for ( new i = 0; i < iNum; i++ )
Others = zp_get_user_ammo_packs(i)
if ( Players == 0 )
ChatColor( id, "%L", LANG_PLAYER, "NO_PLAYERS" )
else if ( iAmmoPacks == Others )
ChatColor( id, "%L", LANG_PLAYER, "MORE_LEADERS" )
else
ChatColor( id, "%L", LANG_PLAYER, "LEADER", szName, iAmmoPacks )
}
return PLUGIN_HANDLED;
}
GetLeader( &iAmmoPacks )
{
new iPlayers[32], iNum, id, i, iLeader, iPacks
get_players( iPlayers, iNum, "ch" )
for ( i = 0; i < iNum; i++ )
{
id = iPlayers[i]
iPacks = zp_get_user_ammo_packs(id)
if ( iPacks > iAmmoPacks )
{
iAmmoPacks = iPacks
iLeader = id
}
}
return iLeader;
}
// ChatColor!
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for ( new i = 0; i < count; i++ )
{
if ( is_user_connected(players[i]) )
{
message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
// Users Get Playing (Stock from the ZP)
UsersGetPlaying()
{
static iPlaying, id
iPlaying = 0
for ( id = 1; id <= MaxPlayers; id++ )
{
if ( is_user_connected(id) )
{
if ( get_user_team(id) == 1 || get_user_team(id) == 2 )
iPlaying++
}
}
return iPlaying;
}
arata la inceputul rundei cine are cele mai multe credite, dar eu vreau:
1. Sa arate cand se termina runda cine a facut cele mai multe credite runda respectiva.
2. Sa-mi apara mie(de ex) daca nu sunt liderul:
[ZMP] Liderul este %s cu %d credite facute aceasta runda.
[ZMP] Tu ai facut %d credite aceasta runda.
Sau daca am cheltuit si n-am recuperat cheltuielile:
[ZMP] Tu ai pierdut %d credite aceasta runda.
3. Sa-i apara liderului (si sa primeasca 5 credite):
[ZMP] Runda asta tu ai facut cele mai multe credite (%d credite) si ai primit cadou 5 credite.
Asta e lang:
Code:
[en]
LEADER = !y[!gZMP!y] Liderul este !g%s !ycu !g%d !ycredite facute aceasta runda.
NO_PLAYERS = !y[!gZMP!y] Nu sunt jucatori conectati.
MORE_LEADERS = !y[!gZMP!y] Sunt !g2 (sau mai multi)!yjucatori cu !gaceleasi !ycredite, !gnimeni !ynu este lider.
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
EDUTz
, 15 May 2015 13:07
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 02-12-2024, 14:25:28
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