Jump to content
GIGN Forum

Sveiki Visi


Recommended Posts

Sveiki man ir problēma .

Serverī ir /iedot plugins , bet 1 raunda tauta vienam

cilvēkam saziedo naudu , ka sanāk pat awp .

Bišķīt unfear . Es forumā meklēju , kā var uzlikt pluginu , lai

viņš strādātu no 2 vai 3 raunda .

Esu meklēji šaja sadaļā ar nosaukumu iedot plugins . Esu atradis daudz topicus ar /iedot plugina

uztādijumiem , bet tas man gluži nav palīdzējis .

Lūdzu esat atsaucīgi un isplaīdzat .

Link to comment
Share on other sites

Kods.

/*

-=MONEY-GIVE=-

Each player can be donated to other players.

================================================

-=VERSIONS=-

Releaseed(Time in JP) Version comment

------------------------------------------------

2005/01/29 1.02 main release

2005/01/29 1.03 Rename

2005/03/11 1.04 Can donate to the immunity.

Bot was stopped in the reverse.

2006/03/15 1.05 Any bugfix

================================================

-=INSTALLATION=-

Compile and install plugin. (configs/plugins.ini)

================================================

-=USAGE=-

Client command / say donate

-show donate menu

Server command / amx_donate_max

-A limit of amount of money to have

-default $16000

================================================

-=SpecialThanks=-

Idea Mr.Kaseijin

Tester Mr.Kaseijin

orutiga

justice

================================================

*/

#include <amxmodx>

#include <amxmisc>

#include <cstrike>

new g_menuPosition[33]

new g_menuPlayers[33][32]

new g_menuPlayersNum[33]

new g_menuOption[33]

new g_menuSettings[33]

new g_coloredMenus

new money[33]

public plugin_init()

{

register_plugin("MONEY-GIVE","1.05","+ARUKARI-")

register_clcmd("say donate","cmdDonateMenu")

register_clcmd("say_team donate","cmdDonateMenu")

register_cvar("amx_donate_max","16000")

register_menucmd(register_menuid("Donate Menu"),1023,"actionDonateMenu")

return PLUGIN_CONTINUE

}

public plugin_modules() {

require_module("cstrike")

}

public actionDonateMenu(id,key) {

switch (key) {

case 7: {

++g_menuOption[id]

g_menuOption[id] %= 7

switch (g_menuOption[id]) {

case 1: g_menuSettings[id] = 100

case 2: g_menuSettings[id] = 500

case 3: g_menuSettings[id] = 1000

case 4: g_menuSettings[id] = 5000

case 5: g_menuSettings[id] = 10000

case 6: g_menuSettings[id] = 15000

}

displayDonateMenu(id,g_menuPosition[id])

}

case 8: displayDonateMenu(id,++g_menuPosition[id])

case 9: displayDonateMenu(id,--g_menuPosition[id])

default: {

new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]

new name2[32]

get_user_name(player,name2,31)

new name[32]

get_user_name(id,name,31)

money[id] = g_menuSettings[id]

new setidmoney[32]

new setplmoney[32]

new maxmoney = get_cvar_num("amx_donate_max")

setplmoney[id] = (cs_get_user_money(player) + money[id])

if (cs_get_user_money(id) < money[id]){

client_print(id,print_chat,"[AMXX] You don't have enough money to donating!")

return PLUGIN_HANDLED

}else if (maxmoney < (setplmoney[id])){

new overplmoney[32]

overplmoney[id]= (maxmoney - cs_get_user_money(player))

setidmoney[id] = (cs_get_user_money(id) - overplmoney[id])

cs_set_user_money(id,setidmoney[id])

cs_set_user_money(player,maxmoney)

client_print(id,print_chat,"[AMXX] $%d was donated to ^"%s^".",money[id],name2)

client_print(player,print_chat,"[AMXX] $%d was donated from ^"%s^".",money[id],name)

return PLUGIN_HANDLED

}else{

setidmoney[id] = (cs_get_user_money(id) - money[id])

cs_set_user_money(id,setidmoney[id])

cs_set_user_money(player,setplmoney[id])

client_print(id,print_chat,"[AMXX] $%d was donated to ^"%s^".",money[id],name2)

client_print(player,print_chat,"[AMXX] $%d was donated from ^"%s^".",money[id],name)

return PLUGIN_HANDLED

}

displayDonateMenu(id,g_menuPosition[id])

}

}

return PLUGIN_HANDLED

}

displayDonateMenu(id,pos) {

if (pos < 0) return

get_players(g_menuPlayers[id],g_menuPlayersNum[id])

new menuBody[512]

new b = 0

new i

new name[32], team[4]

new start = pos * 7

if (start >= g_menuPlayersNum[id])

start = pos = g_menuPosition[id] = 0

new len = format(menuBody,511, g_coloredMenus ?

"\yDonate Menu\R%d/%d^n\w^n" : "Donate Menu : Player-List %d/%d^n^n",

pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )

new end = start + 7

new keys = MENU_KEY_0|MENU_KEY_8

if (end > g_menuPlayersNum[id])

end = g_menuPlayersNum[id]

for (new a = start; a < end; ++a) {

i = g_menuPlayers[id][a]

get_user_name(i,name,31)

get_user_team(i,team,3)

if ( is_user_bot(i)||i == id) {

++b

if ( g_coloredMenus )

len += format(menuBody[len],511-len,"\d%d. %s\R%s^n\w", b,name,team)

else

len += format(menuBody[len],511-len,"\d%d. %s\R%s^n\w", b,name,team)

}

else

{

keys |= (1<<B)

len += format(menuBody[len],511-len, g_coloredMenus ?

"%d. %s\y\R%s^n\w" : "%d. %s\R%s^n",++b,name,team)

}

}

if ( g_menuOption[id] )

len += format(menuBody[len],511-len,"^n8. The amount of money : $ %d^n",g_menuSettings[id] )

else

len += format(menuBody[len],511-len,"^n8. The amount of money : $ 0^n")

if (end != g_menuPlayersNum[id]) {

format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")

keys |= MENU_KEY_9

}

else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")

show_menu(id,keys,menuBody,-1,"Donate Menu")

}

public cmdDonateMenu(id,level,cid)

{

if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED

g_menuOption[id] = 0

g_menuSettings[id] = 0

displayDonateMenu(id,g_menuPosition[id] = 0)

return PLUGIN_HANDLED

}

Jap pagaidām ir uz donate uzlikts . Vēlāk izlabošu .

Link to comment
Share on other sites

Easy! KSO variantā iedot naudu var tikai tad, ja tev pašam ir 1k uz rokas. SMA failā droši vien ir jābūt noteiktai summai, no kuras var vispār iedot.

wow, laba ideja, sen jau gribeju savam variantam uztaisit, ka no 1 raunda nevar... bet man naca prata hookot raundus, tad visus restartus, kas iespejami, vai ari kko ar speletaju fragiem, vai vispar global delay uztaisit pluginam... un ta ari nebija gribas ar tadam idejam chakareties )) shis variants ir daudz vienkarshaks, beet... tur ari janjem vera visi tie VIP prikoli, kas naudu vairak dod, utt. hm., tomer kko stabilaku vajadzetu :/

Link to comment
Share on other sites

beet... tur ari janjem vera visi tie VIP prikoli, kas naudu vairak dod, utt. hm., tomer kko stabilaku vajadzetu :/

Ideja par naudas došanu citiem tikai, ja pašam ir noteikta summa, šķiet, laba un stabila. Jāpārbauda jau tikai, cik spēlētājam naudas ir konkrētajā brīdī. Īsti neredzu, kā VIP fīčas varētu traucēt.

Turklāt to visu var uztaisīt bezmazvai ar viena IFa palīdzību.

Link to comment
Share on other sites

if( get_cvar_num( "mp_startmoney" ) >= cs_get_user_money( id ) )

{

client_print( id, print_center, "Mazs sakuma kapitals... pataupi vel naudu" ) ;

return PLUGIN_HANDLED ;

}

un VIP chalim uztaisit vel vienu if, tip

if ( ( get_user_flags (id) & ADMIN_VIP ) &&

( get_cvar_num( "mp_startmoney" ) + vip_bonuss ) >= cs_get_user_money( id ) ) ) ;

{ ... }

bet nu es tomer gribetu, lai cilveki varetu iedot naudu nakamajos raundos, ja viniem ari nav vajadziga limita.

Link to comment
Share on other sites

Tikai tad, ja tu esi piejoinojies tieši raunda sākumā, tev var būt zem 1k, vai arī, ja tu esi ar bombu rokās, neizpildījis objektīvu un tev ir bijis zem 1k ( tad nauda nākošajā raundā gandrīz nemaz vai nemaz neplusojas ), visādi citādi 1k+ ir garantēta summa otrajā raundā jebkuram spēlētājam.

Link to comment
Share on other sites

Round start event'a gadījumā palielini savu mainīgo par 1. Tiklīdz ir sasniegts vajadzīgais raunds tā aktivizē iespēju. (pats nepārbaudīju, bet citos pluginos šāda lieta strādā)

Šeit, protams, round draw neko neietekmēs, bet round restart gan varētu visu sabojāt.

Link to comment
Share on other sites

Scorp, tur jau ta lieta, ka tas ir vienigais normalais variants, bet, ka jau pirms tam rakstiju, vajag hookot vel kadus 3 - 4 eventus, kas taisa round rr... protams, nekas liels, vienkarshi, tad paliek slinkums to darit un tiesham gribas kko vienkarshaku :D

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...