AdminMod.de https://www.adminmod.de/ |
|
Brauche nochmal hilfe mit dem "sound" !!! https://www.adminmod.de/viewtopic.php?t=6890 |
Seite 1 von 1 |
Autor: | G@nGsT@r [ 05.06.2003, 14:30 ] |
Betreff des Beitrags: | Brauche nochmal hilfe mit dem "sound" !!! |
Hi Leute Könnt ihr mir helfen? Wenn ich z.B amx_mapvote de_dust eingebe erscheint ja der vote auf allen bildschirm! Ich möchte aber noch zusätzlich ein sound dabei haben! Wenn der vote erscheint soll noch der sound "vote now" (UT sound) kommen! Wenn er denn fehlschlägt "vote failed" und eben wenn er erfolgreich ist "vote past"! Könnt ihr mir helfen? Grez Star |
Autor: | ST4life [ 05.06.2003, 14:33 ] |
Betreff des Beitrags: | |
musst den scriptcode umschreiben! jedoch kommts darauch an welches votescript du benutzt, denn standartmaäßig heisst es amx_votemap und nicht amx_mapvote und daher weiss ich nicht welches plugin du benutzt |
Autor: | G@nGsT@r [ 05.06.2003, 14:36 ] |
Betreff des Beitrags: | I dont now |
Wo kan man denn nachgucken welches plugin man benutzt! wenn ich amx_votemap mache geht nicht! sag er Unkown command! |
Autor: | ST4life [ 05.06.2003, 15:00 ] |
Betreff des Beitrags: | |
welche amx version benutzt du denn? normalerweise ist das plugin adminvote.amx |
Autor: | G@nGsT@r [ 05.06.2003, 16:27 ] |
Betreff des Beitrags: | Versioon |
Meine amx Version ist: 0.9.3 |
Autor: | ST4life [ 07.06.2003, 12:11 ] |
Betreff des Beitrags: | |
in den amx examples ordner gehen und die adminvote.sma öffnen. [--SUCHEN--] console_print(id,"Voting has started...") (kommt 3x vor) [--ANHÄNGEN--] client_cmd(id,"spk misc/votenow") [--SUCHEN--] if (result_v<vote_ratio){ [--ANHÄNGEN--] client_cmd(id,"spk misc/votefailed") [--SUCHEN--] new execute[256] [--ANHÄNGEN--] client_cmd(id,"spk misc/votepast") dann das ganze mit dem sc compiler kompilieren (einfach sc.bat ausführen) und im unterordner "compiled" die datei adminvote.amx auf deinen server laden und neustarten! misc/votepast = cstrike/sound/misc/votepast.wav hier also nicht die endung .wav angeben! |
Autor: | Rinde [ 07.06.2003, 13:45 ] |
Betreff des Beitrags: | |
die sounds sollten precached werden |
Autor: | ST4life [ 07.06.2003, 16:46 ] |
Betreff des Beitrags: | |
ich habe mal drauf gehofft, dass er das schon in seine res dateien eingegeben hat ..., ansonsten haste recht! |
Autor: | G@nGsT@r [ 09.06.2003, 15:21 ] |
Betreff des Beitrags: | Ausgeführt |
Soo Ich habe die adminvote.sma umgeändert wie befohlen Hier ist die /* AMX Mod script. * * (c) Copyright 2002, OLO * This file is provided as is (no warranties). * */ #include <amxmod> #include <amxmisc> /* * vote for changing the level: * amx_votemap < map > [ map ] * examples: * amx_votemap "de_dust" * amx_votemap "de_dust" "de_dust2" "cs_italy" * * vote for kicking the player: * amx_votekick < part of nick > * examples: * amx_votekick "Man" * * vote for banning and kicking the player for 30 minutes: * amx_voteban < part of nick > * examples: * amx_voteban "Man" * * custom voting: * amx_vote < question > < answer1 > < answer2 > * examples: * amx_vote "sv_restart" "5" "0" * amx_vote "mp_timelimit" "20" "45" * amx_vote "are you hungry?" "yes" "no" * */ new bool:cstrike_running new answer[128] new option_name[4][32] new option[4] new valid_maps = 0 new Float:vote_ratio new yesnovote new bool:executeresult new logfilename[256] public delay_action(cmd[]) server_cmd(cmd) public check_votes() { new players[32], inum, best = 0 get_players(players,inum,"c") for(new a = 0; a < 4; ++a) if (option[a] > option[best]) best = a new Float:result_v = inum ? (float(option[best]) / float(inum)) : 0.0 if (result_v<vote_ratio){client_cmd(id,"spk misc/votefailed") if (yesnovote) client_print(0,print_chat,"* Voting failed (yes ^"%d^") (no ^"%d^") (needed ^"%.2f^")", option[0], inum-option[0] ,vote_ratio) else client_print(0,print_chat,"* Voting failed (ratio ^"%.2f^") (needed ^"%.2f^")", result_v, vote_ratio) log_to_file(logfilename,"Vote: Voting failed (ratio ^"%.2f^") (needed ^"%.2f^")", result_v, vote_ratio) return PLUGIN_HANDLED } new execute[256]client_cmd(id,"spk misc/votepast") new len = format(execute,255,answer,option_name[best]) if (executeresult){ executeresult = false set_task(2.0,"delay_action",0,execute,len + 1) } client_print(0,print_chat,"* Voting successful (ratio ^"%.2f^") (needed ^"%.2f^"). The result: %s", result_v,vote_ratio,execute) log_to_file(logfilename,"Vote: Voting successful (ratio ^"%.2f^") (needed ^"%.2f^") (result ^"%s^")", result_v,vote_ratio,execute) return PLUGIN_HANDLED } public vote_count(id,key){ if (get_cvar_float("amx_vote_answers")) { new name[32] get_user_name(id,name,31) if (yesnovote) client_print(0,print_chat,"* %s voted %s",name,key ? "against" : "for" ) else client_print(0,print_chat,"* %s voted for option #%d",name,key+1) } if (yesnovote){ if (!key) ++option[key] } else ++option[key] return PLUGIN_HANDLED } public admin_votemap(id,level,cid) { if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()){ console_print(id,"There is already one voting...") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { console_print(id,"Voting not allowed at this time") return PLUGIN_HANDLED } new argc = read_argc() if (argc > 5) argc = 5 valid_maps = 0 option_name[0][0] = option_name[1][0] = option_name[2][0] = option_name[3][0] = 0 for(new i = 1; i < argc; ++i){ read_argv(i,option_name[valid_maps],31) if (is_map_valid(option_name[valid_maps])) valid_maps++; } if (valid_maps == 0) { console_print(id,"Given %s not valid",(argc==2)?"map is":"maps are") return PLUGIN_HANDLED } new menu_msg[256] new keys = 0 if (valid_maps > 1){ keys = (1<<9) if(cstrike_running) copy(menu_msg,255,"\yAMX Choose map \w^n^n") else copy(menu_msg,255,"AMX Choose map ^n^n") new temp[128] for(new a = 0; a < valid_maps; ++a){ format(temp,127,"%d. %s^n",a+1,option_name[a]) add(menu_msg,255,temp) keys |= (1<<a) } add(menu_msg,255,"^n0. None") yesnovote = 0 } else{ if(cstrike_running) format(menu_msg,255,"\yAMX Change map to %s?\w^n^n1. Yes^n2. No",option_name[0]) else format(menu_msg,255,"AMX Change map to %s?^n^n1. Yes^n2. No",option_name[0]) keys = (1<<0)|(1<<1) yesnovote = 1 } new authid[16],name[32] get_user_authid(id,authid,15) get_user_name(id,name,31) if (argc==2) log_to_file(logfilename,"Vote: ^"%s<%d><%s><>^" vote map (map ^"%s^")", name,get_user_userid(id),authid,option_name[0]) else log_to_file(logfilename,"Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name,get_user_userid(id),authid,option_name[0],option_name[1],option_name[2],option_name[3]) switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"%s %s: vote map(s)",name, (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN") case 1: client_print(0,print_chat,"%s: vote map(s)", (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN") } executeresult = true new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time ) vote_ratio = get_cvar_float("amx_votemap_ratio") copy(answer,127,"changelevel %s") show_menu(0,keys,menu_msg,floatround(vote_time)) set_task(vote_time,"check_votes") console_print(id,"Voting has started...")client_cmd(id,"spk misc/votenow") for(new j=0;j<4;++j)option[j]=0 return PLUGIN_HANDLED } public admin_vote(id,level,cid) { if (!cmd_access(id,level,cid,4)) return PLUGIN_HANDLED new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()){ console_print(id,"There is already one voting...") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { console_print(id,"Voting not allowed at this time") return PLUGIN_HANDLED } new quest[48] read_argv(1,quest,47) if ((contain(quest,"sv_password")!=-1)||(contain(quest,"rcon_password")!=-1)|| (contain(quest,"kick")!=-1)||(contain(quest,"addip")!=-1)||(contain(quest,"ban")!=-1)){ console_print(id,"Voting for that has been forbidden") return PLUGIN_HANDLED } read_argv(2,option_name[0],31) read_argv(3,option_name[1],31) new authid[16],name[32] get_user_authid(id,authid,15) get_user_name(id,name,31) log_to_file(logfilename,"Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name,get_user_userid(id),authid,quest,option_name[0],option_name[1]) switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"%s %s: vote custom", (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN",name ) case 1: client_print(0,print_chat,"%s: vote custom", (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN") } new menu_msg[256] new keys = (1<<0)|(1<<1) if(cstrike_running) format(menu_msg,255,"\yAMX Vote: %s?\w^n^n1. %s^n2. %s",quest,option_name[0],option_name[1]) else format(menu_msg,255,"AMX Vote: %s?^n^n1. %s^n2. %s",quest,option_name[0],option_name[1]) executeresult = false new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time ) vote_ratio = get_cvar_float("amx_vote_ratio") format(answer,127,"%s %%s",quest) show_menu(0,keys,menu_msg,floatround(vote_time)) set_task(vote_time,"check_votes") console_print(id,"Voting has started...")client_cmd(id,"spk misc/votenow") for(new j=0;j<4;++j)option[j]=0 yesnovote = 0 return PLUGIN_HANDLED } public admin_votekickban(id,level,cid) { if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED new Float:voting = get_cvar_float("amx_last_voting") if (voting > get_gametime()){ console_print(id,"There is already one voting...") return PLUGIN_HANDLED } if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) { console_print(id,"Voting not allowed at this time") return PLUGIN_HANDLED } new cmd[32] read_argv(0,cmd,31) new voteban = equal(cmd,"amx_voteban") ? 1 : 0 new arg[32] read_argv(1,arg,31) new player = cmd_target(id,arg,1) if (!player) return PLUGIN_HANDLED if (voteban && is_user_bot(player)) { new imname[32] get_user_name(player,imname,31) console_print(id,"That action can't be performed on bot ^"%s^"",imname) return PLUGIN_HANDLED } new keys = (1<<0)|(1<<1) new menu_msg[256] get_user_name(player,arg,31) if(cstrike_running) format(menu_msg,255,"\yAMX %s %s?\w^n^n1. Yes^n2. No", voteban ? "Ban" : "Kick", arg) else format(menu_msg,255,"AMX %s %s?^n^n1. Yes^n2. No", voteban ? "Ban" : "Kick", arg) yesnovote = 1 if (voteban) get_user_authid(player,option_name[0],31) else num_to_str(get_user_userid(player),option_name[0],31) new authid[16],name[32] get_user_authid(id,authid,15) get_user_name(id,name,31) log_to_file(logfilename,"Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name,get_user_userid(id),authid,voteban ? "ban" : "kick",arg) switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"%s %s: vote %s for %s", (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN",name,voteban ? "ban" : "kick",arg ) case 1: client_print(0,print_chat,"%s: vote %s for %s", (get_user_flags(id) & ADMIN_USER) ? "PLAYER" : "ADMIN",voteban ? "ban" : "kick",arg) } executeresult = true new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0 set_cvar_float("amx_last_voting", get_gametime() + vote_time ) vote_ratio = get_cvar_float(voteban ? "amx_voteban_ratio" : "amx_votekick_ratio") copy(answer,127, voteban ? "banid 30.0 %s kick" : "kick #%s") show_menu(0,keys,menu_msg,floatround(vote_time)) set_task(vote_time,"check_votes") console_print(id,"Voting has started...")client_cmd(id,"spk misc/votenow") for(new j=0;j<4;++j)option[j]=0 return PLUGIN_HANDLED } public plugin_init() { register_plugin("Admin Votes","0.9.2","default") register_menucmd(register_menuid("AMX Change map to ") ,(1<<0)|(1<<1),"vote_count") register_menucmd(register_menuid("AMX Choose map ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"vote_count") register_menucmd(register_menuid("AMX Kick ") ,(1<<0)|(1<<1),"vote_count") register_menucmd(register_menuid("AMX Ban ") ,(1<<0)|(1<<1),"vote_count") register_menucmd(register_menuid("AMX Vote: ") ,(1<<0)|(1<<1),"vote_count") register_concmd("amx_votemap","admin_votemap",ADMIN_VOTE,"<map> [map] [map] [map]") register_concmd("amx_votekick","admin_votekickban",ADMIN_VOTE,"<authid, nick or #userid>") register_concmd("amx_voteban","admin_votekickban",ADMIN_VOTE,"<authid, nick or #userid>") register_concmd("amx_vote","admin_vote",ADMIN_VOTE,"<question> <answer#1> <answer#2>") register_cvar("amx_votekick_ratio","0.40") register_cvar("amx_voteban_ratio","0.40") register_cvar("amx_votemap_ratio","0.40") register_cvar("amx_vote_ratio","0.02") register_cvar("amx_vote_time","10") register_cvar("amx_vote_answers","1") register_cvar("amx_vote_delay","60") register_cvar("amx_last_voting","0") set_cvar_float("amx_last_voting",0.0) register_cvar("amx_show_activity","2") new mod_name[32] get_modname(mod_name,31) cstrike_running = equal(mod_name,"cstrike") ? true : false get_time("addons/amx/logs/admin%m%d.log",logfilename,255) return PLUGIN_CONTINUE } Und dann habe ich einmal sc.bat ausgeführt! Dann bin ich in denn Compiled ordner gegangen und da war keine adminvote.amx datei....! Und was soll ich in den .res dateien reinschribbeln? denn pfad zu denn votenow,votepassed und votefailed? Grez Star |
Autor: | ST4life [ 09.06.2003, 17:13 ] |
Betreff des Beitrags: | |
was sagt dir denn der compiler? irgendwelche fehlermeldungen? |
Autor: | G@nGsT@r [ 09.06.2003, 17:42 ] |
Betreff des Beitrags: | Error |
Habe ich eben erst gesehen ! Er sagt es sind 6 Fehler da! adminvote.sma(58) : error 017: undefined symbol "id" adminvote.sma(60) : warning 217: loose indentation adminvote.sma(70) : error 001: expected token: ";", but found "-identifier-" adminvote.sma(70) : error 017: undefined symbol "id" adminvote.sma(71) : warning 217: loose indentation adminvote.sma(72) : warning 217: loose indentation adminvote.sma(175) : error 001: expected token: ";", but found "-identifier-" adminvote.sma(229) : error 001: expected token: ";", but found "-identifier-" adminvote.sma(293) : error 001: expected token: ";", but found "-identifier-" Kann damit nichts anfangen du? Help Pls.. Grez Star |
Autor: | ST4life [ 09.06.2003, 18:53 ] | ||
Betreff des Beitrags: | |||
ich habe es mal geschrieben und liegt jetzt im anhang. musst nur noch die adminvote.amx im plugins ordner überschreiben mit der im anhang. außerdem musst du nichts mehr in die res dateien schreiben, macht das plugin! die dateien müssen votepast.wav, votefailed.wav und votenow.wav heissen und im cstrike/misc/ ordner liegen! das wärs dann
|
Autor: | G@nGsT@r [ 09.06.2003, 19:25 ] |
Betreff des Beitrags: | THX |
Hmmm jetzt funz es! Danke für die hilfe und die adminvote.amx datei! Grez Star |
Seite 1 von 1 | Alle Zeiten sind UTC+01:00 |
Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |