[Cerere Plugin] Money Management
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
Forum rules
Accesează link-ul pentru a putea vedea regulile forumului
Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Accesează link-ul pentru a putea vedea regulile forumului
Daca doriti sa vi se modifice un plugin, va rugam postati aici .
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
Plugin Cerut: Money Management
Descriere (adica ce face el mai exact): o dau jos
Serverul impune conditii strict HLDS/REHLDS?: rehlds
Ai cautat pluginul?(daca da, precizeaza cum): da
Necesita mod special?: nu
deci as avea nevoie urgenta de un plugin care face urmatoarele chestii:
1. sa salveze banii intr-un fvault/nvault.
2. cand intri prima data pe server sa ai 0$
3. Cand omori pe cineva sa-ti dea 25$ (indiferent t/ct)
4. Cand incepe runda urmatoare sa nu primesti acel bonus!
5. sa fie ulimited money, acela peste 16k
6. comanda amx_addmoney si comanda amx_removemoney
am facut o cerere si pe allied dar nu a raspuns nimeni si eu char am nevoie urgenta de acest plugin! sunt dispus sa si platesc!!
am lasat aici surse de la diferite pluginuri, poate va ajuta https://forums.alliedmods.net/showthread.php?t=320963
eu folosesc momentan 4 pluginuri care sa-mi faca ce as vrea eu dar nu merg bine, si daca e posibil ca cineva sa faca din toate doar 1!
multumesc frumos!
Descriere (adica ce face el mai exact): o dau jos
Serverul impune conditii strict HLDS/REHLDS?: rehlds
Ai cautat pluginul?(daca da, precizeaza cum): da
Necesita mod special?: nu
deci as avea nevoie urgenta de un plugin care face urmatoarele chestii:
1. sa salveze banii intr-un fvault/nvault.
2. cand intri prima data pe server sa ai 0$
3. Cand omori pe cineva sa-ti dea 25$ (indiferent t/ct)
4. Cand incepe runda urmatoare sa nu primesti acel bonus!
5. sa fie ulimited money, acela peste 16k
6. comanda amx_addmoney si comanda amx_removemoney
am facut o cerere si pe allied dar nu a raspuns nimeni si eu char am nevoie urgenta de acest plugin! sunt dispus sa si platesc!!
am lasat aici surse de la diferite pluginuri, poate va ajuta https://forums.alliedmods.net/showthread.php?t=320963
eu folosesc momentan 4 pluginuri care sa-mi faca ce as vrea eu dar nu merg bine, si daca e posibil ca cineva sa faca din toate doar 1!
multumesc frumos!
maybe there are no goodbyes..
- 1TAP GOD
- Membru, skill +1
- Posts: 152
- Joined: 03 Sep 2018, 00:20
- Detinator Steam: Da
- SteamID: /id/assasinssmdfk
- Fond eXtream: 0
- Has thanked: 16 times
- Been thanked: 16 times
Nu intleg la ce bonus te referi ,poți să îmi explici ?
----------------Steam----------------
-----------------------------------------------------------
And she be actin' funny, probably think a nigga need her
I thought I was faithful, she say I'm a cheater
They thought I was taken, I'm ready to mingle
I thought I was faithful, she say I'm a cheater
They thought I was taken, I'm ready to mingle
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
cand se termina runda, primesti bani in plus, nu stiu exact cum si cat, dar e bonusul ala de bani care-l primesti de fiecare runda pentru are!
in linkul de sus este pluginul care sa impiedice asta!
in linkul de sus este pluginul care sa impiedice asta!
maybe there are no goodbyes..
- levin
- Scripter eXtreamCS
- Posts: 3844
- Joined: 24 Aug 2011, 12:24
- Detinator Steam: Da
- CS Status: ♅
- Detinator server CS: ☯∴
- SteamID: riseofevo
- Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy - Location: ҳ̸Ҳ̸ҳ
- Discord: devilclass
- Has thanked: 36 times
- Been thanked: 594 times
- Contact:
ai cvaruri pe care le poți edita
pentru rehlds aveai - https://forums.alliedmods.net/showthread.php?t=296847 & regamedll pentru bani nelimitați
pentru rehlds aveai - https://forums.alliedmods.net/showthread.php?t=296847 & regamedll pentru bani nelimitați
Code: Select all
/* Formatright © 2010, ConnorMcLeod
Kill Money is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Kill Money; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fvault>
new const g_vault_name[] = "SavedMoney";
#pragma tabsize 0
#define PLUGIN "No RoundEnd Money Bonus"
#define VERSION "0.0.1"
#define MONEY_TIER 99999 // DON'T MESS WITH, Money total at which the plugin switches over keeping track of money
new money_total[33] // Keep track of peeps money if above MONEY_TIER
new gmsg_Money
new amx_maxmoney
new amx_startmoney
//#define VERSION "0.1.1"
enum
{
DeathMsg_KillerID = 1, // byte
DeathMsg_VictimID, // byte
DeathMsg_IsHeadshot, // byte
DeathMsg_TruncatedWeaponName // string
}
#define Money_Amount 1
new g_iMaxPlayers
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define XTRA_OFS_PLAYER 5
#define m_iAccount 115
#define cs_set_money_value(%1,%2) set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER)
new g_pCvarKillMoney, g_pCvarTkMoney, g_pCvarMaxMoney, g_pCvarKillMoneyHs
new g_iNewMoney
new g_iMsgHookMoney
new gmsgMoney
new bool:g_bIsRestarting
new bool:g_bIsNewRound
new g_iNewRoundPlayerMoney[33]
new g_StartMoney, g_FlashGreen, g_FirstSpawn[33];
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" )
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
register_forward(FM_PlaybackEvent, "OnPlaybackEvent_Post", true)
RegisterHam(Ham_Spawn, "player", "OnCBasePlayer_Spawn_Post", true)
gmsgMoney = get_user_msgid("Money")
//register_plugin("Kill Money", VERSION, "ConnorMcLeod")
g_pCvarKillMoney = register_cvar("amx_kill_money", "25")
g_pCvarKillMoneyHs = register_cvar("amx_kill_money_hs", "1")
g_pCvarTkMoney = register_cvar("amx_teamkill_money", "-1")
g_pCvarMaxMoney = register_cvar("amx_killmoney_maxmoney", "99999")
register_event("DeathMsg", "Event_DeathMsg", "a")
g_iMaxPlayers = get_maxplayers()
gmsgMoney = get_user_msgid("Money")
register_event("Money","read_gmsg_Money","b")
amx_startmoney = register_cvar("amx_startmoney", "1")
amx_maxmoney = register_cvar("amx_maxmoney", "16000")
register_concmd("amx_setmoney", "find_money_target",ADMIN_LEVEL_A, "{@team, #userid, or name(can be partial)} <ammount>")
//register_plugin("Start Money Fix", "1.4", "hleV");
g_FlashGreen = register_cvar("smf_flashgreen", "1");
g_StartMoney = get_cvar_pointer("mp_startmoney");
}
public Event_DeathMsg()
{
new iKiller = read_data(DeathMsg_KillerID)
if( IsPlayer(iKiller) && is_user_connected(iKiller) )
{
new iVictim = read_data(DeathMsg_VictimID)
if( iVictim != iKiller )
{
g_iNewMoney = clamp
(
cs_get_user_money(iKiller) + get_pcvar_num( cs_get_user_team(iVictim) == cs_get_user_team(iKiller) ? g_pCvarTkMoney : (read_data(DeathMsg_IsHeadshot) ? g_pCvarKillMoneyHs : g_pCvarKillMoney) ),
0,
get_pcvar_num(g_pCvarMaxMoney)
)
g_iMsgHookMoney = register_message(gmsgMoney, "Message_Money")
}
}
}
public Message_Money(iMsgId, iMsgDest, id)
{
unregister_message(gmsgMoney, g_iMsgHookMoney)
cs_set_money_value(id, g_iNewMoney)
set_msg_arg_int(Money_Amount, ARG_LONG, g_iNewMoney)
}
public Event_TextMsg_Restart()
{
g_bIsRestarting = true
for (new i=1; i<33; i++) money_total[i] = 0
}
public Event_HLTV_New_Round()
{
if( g_bIsRestarting )
{
g_bIsRestarting = false
return
}
g_bIsNewRound = true
set_msg_block(gmsgMoney, BLOCK_SET)
new players[32], num, id
get_players(players, num, "h")
for(--num; num>=0; num--)
{
id = players[num]
g_iNewRoundPlayerMoney[id] = get_pdata_int(id, m_iAccount)
}
}
public OnCBasePlayer_Spawn_Post( id )
{
if( g_bIsNewRound && is_user_alive(id) )
{
set_pdata_int(id, m_iAccount, g_iNewRoundPlayerMoney[id])
}
if (g_FirstSpawn[id] && is_user_alive(id))
{
g_FirstSpawn[id] = false;
if (get_pcvar_num(g_FlashGreen)) cs_set_user_money(id, 0, 0);
cs_set_user_money(id, get_pcvar_num(g_StartMoney), 0);
}
}
public OnPlaybackEvent_Post()
{
if( g_bIsNewRound )
{
g_bIsNewRound = false
set_msg_block(gmsgMoney, BLOCK_NOT)
}
}
public client_connect(id)
{
set_cvar_float("mp_startmoney", 0.0) // So you can track when to change to amx_startmoney ammount, I know.. a crude method
money_total[id] = 0
g_FirstSpawn[id] = true;
}
public client_authorized(plr)
{
if( !is_user_hltv(plr) && !is_user_bot(plr) )
{
LoadExp(plr);
}
}
public client_disconnect(plr)
{
if( cs_get_user_money(plr) > 0 )
{
SaveExp(plr);
}
}
LoadExp(plr)
{
new authid[35];
get_user_name(plr, authid, sizeof(authid) - 1);
new data[16];
if( fvault_get_data(g_vault_name, authid, data, sizeof(data) - 1) )
{
cs_set_user_money(plr,str_to_num(data))
}
else
{
cs_set_user_money(plr,0);
}
}
SaveExp(plr)
{
new authid[35];
get_user_name(plr, authid, sizeof(authid) - 1);
new data[16];
num_to_str(cs_get_user_money(plr), data, sizeof(data) - 1);
fvault_set_data(g_vault_name, authid, data);
}
public read_gmsg_Money(id) {
if(!is_user_connected(id)) return PLUGIN_HANDLED
new current_total = read_data(1)
if(current_total == 801){ // If CS is spawning you with mp_startmoney default
current_total = get_pcvar_num(amx_startmoney) // current total is actually amx_startmoney
cs_set_user_money(id, current_total,0) // so set user money to amx_startmoney
money_total[id] = 0 // reset
}
if(current_total >= MONEY_TIER && !money_total[id]) // If first time above MONEY_TIER
{
money_total[id] = current_total // Keep track of current total
send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // send money msg of current total
return PLUGIN_CONTINUE
}
if(money_total[id]) // If was over tier on last money message
{
money_total[id] += current_total - MONEY_TIER // figure the term of current total - tier
if(money_total[id] < MONEY_TIER){ // If less then tier set user money to money_total[id] and stop keeping track
cs_set_user_money(id,money_total[id],1)
money_total[id] = 0
}
else{
send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // else send money message
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
//change flash to ammount
public send_moneymsg(id,ammount,flash)
{
cs_set_user_money(id,MONEY_TIER,0) //Set user money to tier ammount so easy to track add and subtract terms
new maxamount = get_pcvar_num(amx_maxmoney)
if(money_total[id] > maxamount)
money_total[id] = maxamount
//send old money
message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id )
write_long(money_total[id]-ammount)
write_byte(0)
message_end()
//send current money
message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) //Send money message with ammount stored in money_total[id]
write_long(money_total[id])
write_byte(flash)
message_end()
}
public find_money_target(id, level, cid)
{
if(!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new target[16], ammount[8], players[32]
new num
read_argv(1,target,15)
read_argv(2,ammount,7)
if(target[0] == '@'){ //If trying to give a team money
if(target[1] == 'C' || target[1] == 'c'){
get_players(players, num ,"e", "CT")
}
else if(target[1] == 'T' || target[1] == 't'){
get_players(players, num ,"e", "TERRORIST")
}
else{
console_print(id, "*** No known team by that name. ***")
return PLUGIN_HANDLED
}
}
else if(target[0] == '#'){ //If trying to give a player(userid) money
new userid = str_to_num(target[1])
players[0] = find_player("k", userid)
}
else{ // else search for matching name to try and give money
players[0] = find_player("bl", target)
}
if(players[0] == 0){ //If no target(s) could be found
console_print(id, "*** No target(s) could be found. ***")
return PLUGIN_HANDLED
}
else
give_money(players, str_to_num(ammount))
return PLUGIN_HANDLED
}
public give_money(players[], ammount)
{
new i
while(players[i]){
if(money_total[players[i]]){
money_total[players[i]] += ammount // Keep track of current total
send_moneymsg(players[i],ammount,1) // send money msg of current total
}
else if( (cs_get_user_money(players[i]) + ammount) >= MONEY_TIER){
money_total[players[i]] = cs_get_user_money(players[i]) + ammount // Keep track of current total
send_moneymsg(players[i],ammount,1) // send money msg of current total
}
else{
ammount += cs_get_user_money(players[i])
cs_set_user_money(players[i],ammount,1)
money_total[players[i]] = 0
}
++i
}
}
public _cs_get_user_money_ul(plug,param) {
if(param != 1)
return PLUGIN_HANDLED
new id = get_param(1)
if (id < 1 || id > get_maxplayers()) {
log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id)
return PLUGIN_HANDLED
} else {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "Invalid player %d", id)
return PLUGIN_HANDLED
}
}
if(money_total[id] < MONEY_TIER) {
return cs_get_user_money(id)
}
else {
return money_total[id]
}
return PLUGIN_HANDLED
}
public _cs_set_user_money_ul(plug,param) {
if(param != 2 && param != 3 )
return PLUGIN_HANDLED
new id = get_param(1)
if (id < 1 || id > get_maxplayers()) {
log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id)
return PLUGIN_HANDLED
} else {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "Invalid player %d", id)
return PLUGIN_HANDLED
}
}
new ammount = get_param(2)
if(ammount >= MONEY_TIER){
new change = ammount - money_total[id]
money_total[id] = ammount
send_moneymsg(id,change,get_param(3))
}
else{
if (ammount < 0) ammount = 0
cs_set_user_money(id,ammount,get_param(3))
money_total[id] = 0
}
return PLUGIN_HANDLED
}
public plugin_natives() {
register_library("money_ul")
register_native("cs_get_user_money_ul","_cs_get_user_money_ul")
register_native("cs_set_user_money_ul","_cs_set_user_money_ul")
}
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
nu merge, imi incepe cu 800 iar cand incepe alta runda imi apare ca am 0 in hud, dar defapt eu am mai mult, mi-am setat prin comanda 5000$ iar runda urmatoare mi-a aparut 0, dar eu aveam 5000$ (am un plugin pentru bet, iar cand am dat bet 300, mi-a luat 300 si atunci a reaparut 4700$ in hud)L E V I N wrote: ↑21 Jan 2020, 18:50ai cvaruri pe care le poți edita
pentru rehlds aveai - https://forums.alliedmods.net/showthread.php?t=296847 & regamedll pentru bani nelimitați
Code: Select all
/* Formatright © 2010, ConnorMcLeod Kill Money is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Kill Money; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta> #include <hamsandwich> #include <fvault> new const g_vault_name[] = "SavedMoney"; #pragma tabsize 0 #define PLUGIN "No RoundEnd Money Bonus" #define VERSION "0.0.1" #define MONEY_TIER 99999 // DON'T MESS WITH, Money total at which the plugin switches over keeping track of money new money_total[33] // Keep track of peeps money if above MONEY_TIER new gmsg_Money new amx_maxmoney new amx_startmoney //#define VERSION "0.1.1" enum { DeathMsg_KillerID = 1, // byte DeathMsg_VictimID, // byte DeathMsg_IsHeadshot, // byte DeathMsg_TruncatedWeaponName // string } #define Money_Amount 1 new g_iMaxPlayers #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers ) #define XTRA_OFS_PLAYER 5 #define m_iAccount 115 #define cs_set_money_value(%1,%2) set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER) new g_pCvarKillMoney, g_pCvarTkMoney, g_pCvarMaxMoney, g_pCvarKillMoneyHs new g_iNewMoney new g_iMsgHookMoney new gmsgMoney new bool:g_bIsRestarting new bool:g_bIsNewRound new g_iNewRoundPlayerMoney[33] new g_StartMoney, g_FlashGreen, g_FirstSpawn[33]; public plugin_init() { register_plugin( PLUGIN, VERSION, "ConnorMcLeod" ) register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0") register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w") register_forward(FM_PlaybackEvent, "OnPlaybackEvent_Post", true) RegisterHam(Ham_Spawn, "player", "OnCBasePlayer_Spawn_Post", true) gmsgMoney = get_user_msgid("Money") //register_plugin("Kill Money", VERSION, "ConnorMcLeod") g_pCvarKillMoney = register_cvar("amx_kill_money", "25") g_pCvarKillMoneyHs = register_cvar("amx_kill_money_hs", "1") g_pCvarTkMoney = register_cvar("amx_teamkill_money", "-1") g_pCvarMaxMoney = register_cvar("amx_killmoney_maxmoney", "99999") register_event("DeathMsg", "Event_DeathMsg", "a") g_iMaxPlayers = get_maxplayers() gmsgMoney = get_user_msgid("Money") register_event("Money","read_gmsg_Money","b") amx_startmoney = register_cvar("amx_startmoney", "1") amx_maxmoney = register_cvar("amx_maxmoney", "16000") register_concmd("amx_setmoney", "find_money_target",ADMIN_LEVEL_A, "{@team, #userid, or name(can be partial)} <ammount>") //register_plugin("Start Money Fix", "1.4", "hleV"); g_FlashGreen = register_cvar("smf_flashgreen", "1"); g_StartMoney = get_cvar_pointer("mp_startmoney"); } public Event_DeathMsg() { new iKiller = read_data(DeathMsg_KillerID) if( IsPlayer(iKiller) && is_user_connected(iKiller) ) { new iVictim = read_data(DeathMsg_VictimID) if( iVictim != iKiller ) { g_iNewMoney = clamp ( cs_get_user_money(iKiller) + get_pcvar_num( cs_get_user_team(iVictim) == cs_get_user_team(iKiller) ? g_pCvarTkMoney : (read_data(DeathMsg_IsHeadshot) ? g_pCvarKillMoneyHs : g_pCvarKillMoney) ), 0, get_pcvar_num(g_pCvarMaxMoney) ) g_iMsgHookMoney = register_message(gmsgMoney, "Message_Money") } } } public Message_Money(iMsgId, iMsgDest, id) { unregister_message(gmsgMoney, g_iMsgHookMoney) cs_set_money_value(id, g_iNewMoney) set_msg_arg_int(Money_Amount, ARG_LONG, g_iNewMoney) } public Event_TextMsg_Restart() { g_bIsRestarting = true for (new i=1; i<33; i++) money_total[i] = 0 } public Event_HLTV_New_Round() { if( g_bIsRestarting ) { g_bIsRestarting = false return } g_bIsNewRound = true set_msg_block(gmsgMoney, BLOCK_SET) new players[32], num, id get_players(players, num, "h") for(--num; num>=0; num--) { id = players[num] g_iNewRoundPlayerMoney[id] = get_pdata_int(id, m_iAccount) } } public OnCBasePlayer_Spawn_Post( id ) { if( g_bIsNewRound && is_user_alive(id) ) { set_pdata_int(id, m_iAccount, g_iNewRoundPlayerMoney[id]) } if (g_FirstSpawn[id] && is_user_alive(id)) { g_FirstSpawn[id] = false; if (get_pcvar_num(g_FlashGreen)) cs_set_user_money(id, 0, 0); cs_set_user_money(id, get_pcvar_num(g_StartMoney), 0); } } public OnPlaybackEvent_Post() { if( g_bIsNewRound ) { g_bIsNewRound = false set_msg_block(gmsgMoney, BLOCK_NOT) } } public client_connect(id) { set_cvar_float("mp_startmoney", 0.0) // So you can track when to change to amx_startmoney ammount, I know.. a crude method money_total[id] = 0 g_FirstSpawn[id] = true; } public client_authorized(plr) { if( !is_user_hltv(plr) && !is_user_bot(plr) ) { LoadExp(plr); } } public client_disconnect(plr) { if( cs_get_user_money(plr) > 0 ) { SaveExp(plr); } } LoadExp(plr) { new authid[35]; get_user_name(plr, authid, sizeof(authid) - 1); new data[16]; if( fvault_get_data(g_vault_name, authid, data, sizeof(data) - 1) ) { cs_set_user_money(plr,str_to_num(data)) } else { cs_set_user_money(plr,0); } } SaveExp(plr) { new authid[35]; get_user_name(plr, authid, sizeof(authid) - 1); new data[16]; num_to_str(cs_get_user_money(plr), data, sizeof(data) - 1); fvault_set_data(g_vault_name, authid, data); } public read_gmsg_Money(id) { if(!is_user_connected(id)) return PLUGIN_HANDLED new current_total = read_data(1) if(current_total == 801){ // If CS is spawning you with mp_startmoney default current_total = get_pcvar_num(amx_startmoney) // current total is actually amx_startmoney cs_set_user_money(id, current_total,0) // so set user money to amx_startmoney money_total[id] = 0 // reset } if(current_total >= MONEY_TIER && !money_total[id]) // If first time above MONEY_TIER { money_total[id] = current_total // Keep track of current total send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // send money msg of current total return PLUGIN_CONTINUE } if(money_total[id]) // If was over tier on last money message { money_total[id] += current_total - MONEY_TIER // figure the term of current total - tier if(money_total[id] < MONEY_TIER){ // If less then tier set user money to money_total[id] and stop keeping track cs_set_user_money(id,money_total[id],1) money_total[id] = 0 } else{ send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // else send money message } return PLUGIN_CONTINUE } return PLUGIN_CONTINUE } //change flash to ammount public send_moneymsg(id,ammount,flash) { cs_set_user_money(id,MONEY_TIER,0) //Set user money to tier ammount so easy to track add and subtract terms new maxamount = get_pcvar_num(amx_maxmoney) if(money_total[id] > maxamount) money_total[id] = maxamount //send old money message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) write_long(money_total[id]-ammount) write_byte(0) message_end() //send current money message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) //Send money message with ammount stored in money_total[id] write_long(money_total[id]) write_byte(flash) message_end() } public find_money_target(id, level, cid) { if(!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED new target[16], ammount[8], players[32] new num read_argv(1,target,15) read_argv(2,ammount,7) if(target[0] == '@'){ //If trying to give a team money if(target[1] == 'C' || target[1] == 'c'){ get_players(players, num ,"e", "CT") } else if(target[1] == 'T' || target[1] == 't'){ get_players(players, num ,"e", "TERRORIST") } else{ console_print(id, "*** No known team by that name. ***") return PLUGIN_HANDLED } } else if(target[0] == '#'){ //If trying to give a player(userid) money new userid = str_to_num(target[1]) players[0] = find_player("k", userid) } else{ // else search for matching name to try and give money players[0] = find_player("bl", target) } if(players[0] == 0){ //If no target(s) could be found console_print(id, "*** No target(s) could be found. ***") return PLUGIN_HANDLED } else give_money(players, str_to_num(ammount)) return PLUGIN_HANDLED } public give_money(players[], ammount) { new i while(players[i]){ if(money_total[players[i]]){ money_total[players[i]] += ammount // Keep track of current total send_moneymsg(players[i],ammount,1) // send money msg of current total } else if( (cs_get_user_money(players[i]) + ammount) >= MONEY_TIER){ money_total[players[i]] = cs_get_user_money(players[i]) + ammount // Keep track of current total send_moneymsg(players[i],ammount,1) // send money msg of current total } else{ ammount += cs_get_user_money(players[i]) cs_set_user_money(players[i],ammount,1) money_total[players[i]] = 0 } ++i } } public _cs_get_user_money_ul(plug,param) { if(param != 1) return PLUGIN_HANDLED new id = get_param(1) if (id < 1 || id > get_maxplayers()) { log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id) return PLUGIN_HANDLED } else { if (!is_user_connected(id)) { log_error(AMX_ERR_NATIVE, "Invalid player %d", id) return PLUGIN_HANDLED } } if(money_total[id] < MONEY_TIER) { return cs_get_user_money(id) } else { return money_total[id] } return PLUGIN_HANDLED } public _cs_set_user_money_ul(plug,param) { if(param != 2 && param != 3 ) return PLUGIN_HANDLED new id = get_param(1) if (id < 1 || id > get_maxplayers()) { log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id) return PLUGIN_HANDLED } else { if (!is_user_connected(id)) { log_error(AMX_ERR_NATIVE, "Invalid player %d", id) return PLUGIN_HANDLED } } new ammount = get_param(2) if(ammount >= MONEY_TIER){ new change = ammount - money_total[id] money_total[id] = ammount send_moneymsg(id,change,get_param(3)) } else{ if (ammount < 0) ammount = 0 cs_set_user_money(id,ammount,get_param(3)) money_total[id] = 0 } return PLUGIN_HANDLED } public plugin_natives() { register_library("money_ul") register_native("cs_get_user_money_ul","_cs_get_user_money_ul") register_native("cs_set_user_money_ul","_cs_set_user_money_ul") }
maybe there are no goodbyes..
- levin
- Scripter eXtreamCS
- Posts: 3844
- Joined: 24 Aug 2011, 12:24
- Detinator Steam: Da
- CS Status: ♅
- Detinator server CS: ☯∴
- SteamID: riseofevo
- Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy - Location: ҳ̸Ҳ̸ҳ
- Discord: devilclass
- Has thanked: 36 times
- Been thanked: 594 times
- Contact:
Code: Select all
/* Formatright © 2010, ConnorMcLeod
Kill Money is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Kill Money; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fvault>
new const g_vault_name[] = "SavedMoney";
#pragma tabsize 0
#define PLUGIN "No RoundEnd Money Bonus"
#define VERSION "0.0.1"
#define MONEY_TIER 99999 // DON'T MESS WITH, Money total at which the plugin switches over keeping track of money
new money_total[33] // Keep track of peeps money if above MONEY_TIER
new gmsg_Money
new amx_maxmoney
new amx_startmoney
//#define VERSION "0.1.1"
enum
{
DeathMsg_KillerID = 1, // byte
DeathMsg_VictimID, // byte
DeathMsg_IsHeadshot, // byte
DeathMsg_TruncatedWeaponName // string
}
#define Money_Amount 1
new g_iMaxPlayers
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define XTRA_OFS_PLAYER 5
#define m_iAccount 115
#define cs_set_money_value(%1,%2) set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER)
new g_pCvarKillMoney, g_pCvarTkMoney, g_pCvarMaxMoney, g_pCvarKillMoneyHs
new g_iNewMoney
new g_iMsgHookMoney
new gmsgMoney
new bool:g_bIsRestarting
new bool:g_bIsNewRound
new g_iNewRoundPlayerMoney[33]
new g_StartMoney, g_FlashGreen, g_FirstSpawn[33];
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" )
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
register_forward(FM_PlaybackEvent, "OnPlaybackEvent_Post", true)
RegisterHam(Ham_Spawn, "player", "OnCBasePlayer_Spawn_Post", true)
gmsgMoney = get_user_msgid("Money")
//register_plugin("Kill Money", VERSION, "ConnorMcLeod")
g_pCvarKillMoney = register_cvar("amx_kill_money", "25")
g_pCvarKillMoneyHs = register_cvar("amx_kill_money_hs", "1")
g_pCvarTkMoney = register_cvar("amx_teamkill_money", "-1")
g_pCvarMaxMoney = register_cvar("amx_killmoney_maxmoney", "99999")
register_event("DeathMsg", "Event_DeathMsg", "a")
g_iMaxPlayers = get_maxplayers()
gmsgMoney = get_user_msgid("Money")
register_event("Money","read_gmsg_Money","b")
amx_startmoney = register_cvar("amx_startmoney", "1")
amx_maxmoney = register_cvar("amx_maxmoney", "16000")
register_concmd("amx_setmoney", "find_money_target",ADMIN_LEVEL_A, "{@team, #userid, or name(can be partial)} <ammount>")
//register_plugin("Start Money Fix", "1.4", "hleV");
g_FlashGreen = register_cvar("smf_flashgreen", "1");
g_StartMoney = get_cvar_pointer("mp_startmoney");
}
public Event_DeathMsg()
{
new iKiller = read_data(DeathMsg_KillerID)
if( IsPlayer(iKiller) && is_user_connected(iKiller) )
{
new iVictim = read_data(DeathMsg_VictimID)
if( iVictim != iKiller )
{
g_iNewMoney = clamp
(
cs_get_user_money(iKiller) + get_pcvar_num( cs_get_user_team(iVictim) == cs_get_user_team(iKiller) ? g_pCvarTkMoney : (read_data(DeathMsg_IsHeadshot) ? g_pCvarKillMoneyHs : g_pCvarKillMoney) ),
0,
get_pcvar_num(g_pCvarMaxMoney)
)
g_iMsgHookMoney = register_message(gmsgMoney, "Message_Money")
}
}
}
public Message_Money(iMsgId, iMsgDest, id)
{
unregister_message(gmsgMoney, g_iMsgHookMoney)
cs_set_money_value(id, g_iNewMoney)
set_msg_arg_int(Money_Amount, ARG_LONG, g_iNewMoney)
}
public Event_TextMsg_Restart()
{
g_bIsRestarting = true
for (new i=1; i<33; i++) money_total[i] = 0
}
public Event_HLTV_New_Round()
{
if( g_bIsRestarting )
{
g_bIsRestarting = false
return
}
g_bIsNewRound = true
set_msg_block(gmsgMoney, BLOCK_SET)
new players[32], num, id
get_players(players, num, "h")
for(--num; num>=0; num--)
{
id = players[num]
g_iNewRoundPlayerMoney[id] = get_pdata_int(id, m_iAccount)
}
}
public OnCBasePlayer_Spawn_Post( id )
{
if(is_user_alive(id))
{
if (g_FirstSpawn[id])
{
g_FirstSpawn[id] = false;
if (get_pcvar_num(g_FlashGreen)) cs_set_user_money(id, 0, 0);
cs_set_user_money(id, get_pcvar_num(g_StartMoney), 0);
return
}
if( g_bIsNewRound ) set_pdata_int(id, m_iAccount, g_iNewRoundPlayerMoney[id])
}
}
public OnPlaybackEvent_Post()
{
if( g_bIsNewRound )
{
g_bIsNewRound = false
set_msg_block(gmsgMoney, BLOCK_NOT)
}
}
public client_connect(id)
{
set_cvar_float("mp_startmoney", 850.0) // So you can track when to change to amx_startmoney ammount, I know.. a crude method
money_total[id] = 0
g_FirstSpawn[id] = true;
}
public client_authorized(plr)
{
if( !is_user_hltv(plr) && !is_user_bot(plr) )
{
LoadExp(plr);
}
}
public client_disconnect(plr)
{
if( cs_get_user_money(plr) > 0 )
{
SaveExp(plr);
}
}
LoadExp(plr)
{
new authid[35];
get_user_name(plr, authid, sizeof(authid) - 1);
new data[16];
if( fvault_get_data(g_vault_name, authid, data, sizeof(data) - 1) )
{
cs_set_user_money(plr,str_to_num(data))
}
else
{
cs_set_user_money(plr,0);
}
}
SaveExp(plr)
{
new authid[35];
get_user_name(plr, authid, sizeof(authid) - 1);
new data[16];
num_to_str(cs_get_user_money(plr), data, sizeof(data) - 1);
fvault_set_data(g_vault_name, authid, data);
}
public read_gmsg_Money(id) {
if(!is_user_connected(id)) return PLUGIN_HANDLED
new current_total = read_data(1)
if(current_total == 801){ // If CS is spawning you with mp_startmoney default
current_total = get_pcvar_num(amx_startmoney) // current total is actually amx_startmoney
cs_set_user_money(id, current_total,0) // so set user money to amx_startmoney
money_total[id] = 0 // reset
}
if(current_total >= MONEY_TIER && !money_total[id]) // If first time above MONEY_TIER
{
money_total[id] = current_total // Keep track of current total
send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // send money msg of current total
return PLUGIN_CONTINUE
}
if(money_total[id]) // If was over tier on last money message
{
money_total[id] += current_total - MONEY_TIER // figure the term of current total - tier
if(money_total[id] < MONEY_TIER){ // If less then tier set user money to money_total[id] and stop keeping track
cs_set_user_money(id,money_total[id],1)
money_total[id] = 0
}
else{
send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // else send money message
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
//change flash to ammount
public send_moneymsg(id,ammount,flash)
{
cs_set_user_money(id,MONEY_TIER,0) //Set user money to tier ammount so easy to track add and subtract terms
new maxamount = get_pcvar_num(amx_maxmoney)
if(money_total[id] > maxamount)
money_total[id] = maxamount
//send old money
message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id )
write_long(money_total[id]-ammount)
write_byte(0)
message_end()
//send current money
message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) //Send money message with ammount stored in money_total[id]
write_long(money_total[id])
write_byte(flash)
message_end()
}
public find_money_target(id, level, cid)
{
if(!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new target[16], ammount[8], players[32]
new num
read_argv(1,target,15)
read_argv(2,ammount,7)
if(target[0] == '@'){ //If trying to give a team money
if(target[1] == 'C' || target[1] == 'c'){
get_players(players, num ,"e", "CT")
}
else if(target[1] == 'T' || target[1] == 't'){
get_players(players, num ,"e", "TERRORIST")
}
else{
console_print(id, "*** No known team by that name. ***")
return PLUGIN_HANDLED
}
}
else if(target[0] == '#'){ //If trying to give a player(userid) money
new userid = str_to_num(target[1])
players[0] = find_player("k", userid)
}
else{ // else search for matching name to try and give money
players[0] = find_player("bl", target)
}
if(players[0] == 0){ //If no target(s) could be found
console_print(id, "*** No target(s) could be found. ***")
return PLUGIN_HANDLED
}
else
give_money(players, str_to_num(ammount))
return PLUGIN_HANDLED
}
public give_money(players[], ammount)
{
new i
while(players[i]){
if(money_total[players[i]]){
money_total[players[i]] += ammount // Keep track of current total
send_moneymsg(players[i],ammount,1) // send money msg of current total
}
else if( (cs_get_user_money(players[i]) + ammount) >= MONEY_TIER){
money_total[players[i]] = cs_get_user_money(players[i]) + ammount // Keep track of current total
send_moneymsg(players[i],ammount,1) // send money msg of current total
}
else{
ammount += cs_get_user_money(players[i])
cs_set_user_money(players[i],ammount,1)
money_total[players[i]] = 0
}
++i
}
}
public _cs_get_user_money_ul(plug,param) {
if(param != 1)
return PLUGIN_HANDLED
new id = get_param(1)
if (id < 1 || id > get_maxplayers()) {
log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id)
return PLUGIN_HANDLED
} else {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "Invalid player %d", id)
return PLUGIN_HANDLED
}
}
if(money_total[id] < MONEY_TIER) {
return cs_get_user_money(id)
}
else {
return money_total[id]
}
return PLUGIN_HANDLED
}
public _cs_set_user_money_ul(plug,param) {
if(param != 2 && param != 3 )
return PLUGIN_HANDLED
new id = get_param(1)
if (id < 1 || id > get_maxplayers()) {
log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id)
return PLUGIN_HANDLED
} else {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "Invalid player %d", id)
return PLUGIN_HANDLED
}
}
new ammount = get_param(2)
if(ammount >= MONEY_TIER){
new change = ammount - money_total[id]
money_total[id] = ammount
send_moneymsg(id,change,get_param(3))
}
else{
if (ammount < 0) ammount = 0
cs_set_user_money(id,ammount,get_param(3))
money_total[id] = 0
}
return PLUGIN_HANDLED
}
public plugin_natives() {
register_library("money_ul")
register_native("cs_get_user_money_ul","_cs_get_user_money_ul")
register_native("cs_set_user_money_ul","_cs_set_user_money_ul")
}
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
dupa ce imi instalez din nou toate programele pentru ca a trebuit sa dau un recovery la windows il voi testa, dar am o intrebare, care este diferenta dintre astea? si daca fac acelasi lucru, nu da cu virgula cand ruleaza amndoua diferit?
multumesc btw
Code: Select all
g_pCvarMaxMoney = register_cvar("amx_killmoney_maxmoney", "99999")
amx_maxmoney = register_cvar("amx_maxmoney", "16000")
maybe there are no goodbyes..
- levin
- Scripter eXtreamCS
- Posts: 3844
- Joined: 24 Aug 2011, 12:24
- Detinator Steam: Da
- CS Status: ♅
- Detinator server CS: ☯∴
- SteamID: riseofevo
- Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy - Location: ҳ̸Ҳ̸ҳ
- Discord: devilclass
- Has thanked: 36 times
- Been thanked: 594 times
- Contact:
nu e diferență...te joci tu cu cvarurile, și cu mp_startmoney
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
aceasi problema!
maybe there are no goodbyes..
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
Code: Select all
L 01/22/2020 - 23:17:18: [CSTRIKE] Invalid player 2
L 01/22/2020 - 23:17:18: [AMXX] Displaying debug trace (plugin "money.amxx")
L 01/22/2020 - 23:17:18: [AMXX] Run time error 10: native error (native "cs_set_user_money")
L 01/22/2020 - 23:17:18: [AMXX] [0] 7a84a3d6d6f55346fe90cc5366cb83d7.sma::LoadExp (line 187)
L 01/22/2020 - 23:17:18: [AMXX] [1] 7a84a3d6d6f55346fe90cc5366cb83d7.sma::client_authorized (line 169)
maybe there are no goodbyes..
- levin
- Scripter eXtreamCS
- Posts: 3844
- Joined: 24 Aug 2011, 12:24
- Detinator Steam: Da
- CS Status: ♅
- Detinator server CS: ☯∴
- SteamID: riseofevo
- Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy - Location: ҳ̸Ҳ̸ҳ
- Discord: devilclass
- Has thanked: 36 times
- Been thanked: 594 times
- Contact:
Code: Select all
/* Formatright © 2010, ConnorMcLeod
Kill Money is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Kill Money; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fvault>
new const g_vault_name[] = "SavedMoney";
#pragma tabsize 0
#define PLUGIN "No RoundEnd Money Bonus"
#define VERSION "0.0.1"
#define MONEY_TIER 99999 // DON'T MESS WITH, Money total at which the plugin switches over keeping track of money
new money_total[33] // Keep track of peeps money if above MONEY_TIER
new gmsg_Money
new amx_maxmoney
new amx_startmoney
//#define VERSION "0.1.1"
enum
{
DeathMsg_KillerID = 1, // byte
DeathMsg_VictimID, // byte
DeathMsg_IsHeadshot, // byte
DeathMsg_TruncatedWeaponName // string
}
#define Money_Amount 1
new g_iMaxPlayers
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define XTRA_OFS_PLAYER 5
#define m_iAccount 115
#define cs_set_money_value(%1,%2) set_pdata_int(%1, m_iAccount, %2, XTRA_OFS_PLAYER)
new g_pCvarKillMoney, g_pCvarTkMoney, g_pCvarMaxMoney, g_pCvarKillMoneyHs
new g_iNewMoney
new g_iMsgHookMoney
new gmsgMoney
new bool:g_bIsRestarting
new bool:g_bIsNewRound
new g_iNewRoundPlayerMoney[33]
new g_StartMoney, g_FlashGreen, g_FirstSpawn[33];
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" )
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
register_forward(FM_PlaybackEvent, "OnPlaybackEvent_Post", true)
RegisterHam(Ham_Spawn, "player", "OnCBasePlayer_Spawn_Post", true)
gmsgMoney = get_user_msgid("Money")
//register_plugin("Kill Money", VERSION, "ConnorMcLeod")
g_pCvarKillMoney = register_cvar("amx_kill_money", "25")
g_pCvarKillMoneyHs = register_cvar("amx_kill_money_hs", "1")
g_pCvarTkMoney = register_cvar("amx_teamkill_money", "-1")
g_pCvarMaxMoney = register_cvar("amx_killmoney_maxmoney", "99999")
register_event("DeathMsg", "Event_DeathMsg", "a")
g_iMaxPlayers = get_maxplayers()
gmsgMoney = get_user_msgid("Money")
register_event("Money","read_gmsg_Money","b")
amx_startmoney = register_cvar("amx_startmoney", "1")
amx_maxmoney = register_cvar("amx_maxmoney", "99999")
register_concmd("amx_setmoney", "find_money_target",ADMIN_LEVEL_A, "{@team, #userid, or name(can be partial)} <ammount>")
//register_plugin("Start Money Fix", "1.4", "hleV");
g_FlashGreen = register_cvar("smf_flashgreen", "1");
g_StartMoney = get_cvar_pointer("mp_startmoney");
}
public Event_DeathMsg()
{
new iKiller = read_data(DeathMsg_KillerID)
if( IsPlayer(iKiller) && is_user_connected(iKiller) )
{
new iVictim = read_data(DeathMsg_VictimID)
if( iVictim != iKiller )
{
g_iNewMoney = clamp
(
cs_get_user_money(iKiller) + get_pcvar_num( cs_get_user_team(iVictim) == cs_get_user_team(iKiller) ? g_pCvarTkMoney : (read_data(DeathMsg_IsHeadshot) ? g_pCvarKillMoneyHs : g_pCvarKillMoney) ),
0,
get_pcvar_num(g_pCvarMaxMoney)
)
g_iMsgHookMoney = register_message(gmsgMoney, "Message_Money")
}
}
}
public Message_Money(iMsgId, iMsgDest, id)
{
unregister_message(gmsgMoney, g_iMsgHookMoney)
cs_set_money_value(id, g_iNewMoney)
set_msg_arg_int(Money_Amount, ARG_LONG, g_iNewMoney)
}
public Event_TextMsg_Restart()
{
g_bIsRestarting = true
for (new i=1; i<33; i++) money_total[i] = 0
}
public Event_HLTV_New_Round()
{
if( g_bIsRestarting )
{
g_bIsRestarting = false
return
}
g_bIsNewRound = true
set_msg_block(gmsgMoney, BLOCK_SET)
new players[32], num, id
get_players(players, num, "h")
for(--num; num>=0; num--)
{
id = players[num]
g_iNewRoundPlayerMoney[id] = get_pdata_int(id, m_iAccount)
}
}
public OnCBasePlayer_Spawn_Post( id )
{
if(is_user_alive(id))
{
if (g_FirstSpawn[id])
{
g_FirstSpawn[id] = false;
if (get_pcvar_num(g_FlashGreen)) cs_set_user_money(id, 0, 0);
cs_set_user_money(id, get_pcvar_num(g_StartMoney), 0);
return
}
if( g_bIsNewRound ) set_pdata_int(id, m_iAccount, g_iNewRoundPlayerMoney[id])
}
}
public OnPlaybackEvent_Post()
{
if( g_bIsNewRound )
{
g_bIsNewRound = false
set_msg_block(gmsgMoney, BLOCK_NOT)
}
}
public client_connect(id)
{
set_cvar_float("mp_startmoney", 850.0) // So you can track when to change to amx_startmoney ammount, I know.. a crude method
money_total[id] = 0
g_FirstSpawn[id] = true;
}
public client_authorized(plr) LoadExp(plr);
public client_disconnect(plr) if( cs_get_user_money(plr) > 0 ) SaveExp(plr);
LoadExp(plr)
{
if(is_user_bot(plr)||is_user_hltv(plr)||!is_user_connected(plr)) return
new authid[35];
get_user_name(plr, authid, sizeof(authid) - 1);
new data[16];
if( fvault_get_data(g_vault_name, authid, data, sizeof(data) - 1) ) cs_set_user_money(plr,str_to_num(data))
else cs_set_user_money(plr,0);
}
SaveExp(plr)
{
new authid[35];
get_user_name(plr, authid, sizeof(authid) - 1);
new data[16];
num_to_str(cs_get_user_money(plr), data, sizeof(data) - 1);
fvault_set_data(g_vault_name, authid, data);
}
public read_gmsg_Money(id) {
if(!is_user_connected(id)) return PLUGIN_HANDLED
new current_total = read_data(1)
if(current_total == 801){ // If CS is spawning you with mp_startmoney default
current_total = get_pcvar_num(amx_startmoney) // current total is actually amx_startmoney
cs_set_user_money(id, current_total,0) // so set user money to amx_startmoney
money_total[id] = 0 // reset
}
if(current_total >= MONEY_TIER && !money_total[id]) // If first time above MONEY_TIER
{
money_total[id] = current_total // Keep track of current total
send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // send money msg of current total
return PLUGIN_CONTINUE
}
if(money_total[id]) // If was over tier on last money message
{
money_total[id] += current_total - MONEY_TIER // figure the term of current total - tier
if(money_total[id] < MONEY_TIER){ // If less then tier set user money to money_total[id] and stop keeping track
cs_set_user_money(id,money_total[id],1)
money_total[id] = 0
}
else{
send_moneymsg(id,current_total-MONEY_TIER,read_data(2)) // else send money message
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
//change flash to ammount
public send_moneymsg(id,ammount,flash)
{
cs_set_user_money(id,MONEY_TIER,0) //Set user money to tier ammount so easy to track add and subtract terms
new maxamount = get_pcvar_num(amx_maxmoney)
if(money_total[id] > maxamount)
money_total[id] = maxamount
//send old money
message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id )
write_long(money_total[id]-ammount)
write_byte(0)
message_end()
//send current money
message_begin( MSG_ONE , gmsg_Money , {0,0,0}, id ) //Send money message with ammount stored in money_total[id]
write_long(money_total[id])
write_byte(flash)
message_end()
}
public find_money_target(id, level, cid)
{
if(!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new target[16], ammount[8], players[32]
new num
read_argv(1,target,15)
read_argv(2,ammount,7)
if(target[0] == '@'){ //If trying to give a team money
if(target[1] == 'C' || target[1] == 'c'){
get_players(players, num ,"e", "CT")
}
else if(target[1] == 'T' || target[1] == 't'){
get_players(players, num ,"e", "TERRORIST")
}
else{
console_print(id, "*** No known team by that name. ***")
return PLUGIN_HANDLED
}
}
else if(target[0] == '#'){ //If trying to give a player(userid) money
new userid = str_to_num(target[1])
players[0] = find_player("k", userid)
}
else{ // else search for matching name to try and give money
players[0] = find_player("bl", target)
}
if(players[0] == 0){ //If no target(s) could be found
console_print(id, "*** No target(s) could be found. ***")
return PLUGIN_HANDLED
}
else
give_money(players, str_to_num(ammount))
return PLUGIN_HANDLED
}
public give_money(players[], ammount)
{
new i
while(players[i]){
if(money_total[players[i]]){
money_total[players[i]] += ammount // Keep track of current total
send_moneymsg(players[i],ammount,1) // send money msg of current total
}
else if( (cs_get_user_money(players[i]) + ammount) >= MONEY_TIER){
money_total[players[i]] = cs_get_user_money(players[i]) + ammount // Keep track of current total
send_moneymsg(players[i],ammount,1) // send money msg of current total
}
else{
ammount += cs_get_user_money(players[i])
cs_set_user_money(players[i],ammount,1)
money_total[players[i]] = 0
}
++i
}
}
public _cs_get_user_money_ul(plug,param) {
if(param != 1)
return PLUGIN_HANDLED
new id = get_param(1)
if (id < 1 || id > get_maxplayers()) {
log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id)
return PLUGIN_HANDLED
} else {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "Invalid player %d", id)
return PLUGIN_HANDLED
}
}
if(money_total[id] < MONEY_TIER) {
return cs_get_user_money(id)
}
else {
return money_total[id]
}
return PLUGIN_HANDLED
}
public _cs_set_user_money_ul(plug,param) {
if(param != 2 && param != 3 )
return PLUGIN_HANDLED
new id = get_param(1)
if (id < 1 || id > get_maxplayers()) {
log_error(AMX_ERR_NATIVE, "Player out of range (%d)", id)
return PLUGIN_HANDLED
} else {
if (!is_user_connected(id)) {
log_error(AMX_ERR_NATIVE, "Invalid player %d", id)
return PLUGIN_HANDLED
}
}
new ammount = get_param(2)
if(ammount >= MONEY_TIER){
new change = ammount - money_total[id]
money_total[id] = ammount
send_moneymsg(id,change,get_param(3))
}
else{
if (ammount < 0) ammount = 0
cs_set_user_money(id,ammount,get_param(3))
money_total[id] = 0
}
return PLUGIN_HANDLED
}
public plugin_natives() {
register_library("money_ul")
register_native("cs_get_user_money_ul","_cs_get_user_money_ul")
register_native("cs_set_user_money_ul","_cs_set_user_money_ul")
}
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
- goeslegendary
- Membru, skill +1
- Posts: 107
- Joined: 14 Sep 2018, 23:35
- Detinator Steam: Da
- CS Status: Sniper & Rifler
- Fond eXtream: 0
- Location: Timisoara
- Has thanked: 4 times
aceasi problema, imi incepe cu 850, a doua runda 0, in hud, exact ca inainte!
maybe there are no goodbyes..