Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <dhudmessage>
- #define PLUGIN "Spreeeee!"
- #define VERSION "0.07"
- #define AUTHOR "R3X"
- #define MAX_PLAYERS 32
- new g_points[MAX_PLAYERS+1][2];
- new g_pointsThisRound[MAX_PLAYERS+1][2];
- new g_cvarEndShow;
- public plugin_init(){
- register_plugin(PLUGIN, VERSION, AUTHOR);
- register_event("DeathMsg","onDeath","a");
- register_event("TextMsg", "resetAll", "a", "2&#Game_will_restart_in" );
- register_event("TextMsg", "resetAll", "a", "2&#Game_C");
- register_logevent("onEndRound", 2, "1=Round_End")
- register_logevent("resetAllThisRound", 2, "1=Round_Start")
- g_cvarEndShow=register_cvar("amx_endshow","1");
- #if defined DEBUG
- register_concmd("show_points","cmd_show_points",ADMIN_KICK);
- #endif
- }
- reset(id){
- g_points[id][0]=0;
- g_points[id][1]=0;
- }
- resetRound(id){
- g_pointsThisRound[id][0]=0;
- g_pointsThisRound[id][1]=0;
- }
- public resetAllThisRound(){
- for(new i=0;i<=MAX_PLAYERS;i++)
- {
- if(is_user_hltv(i))
- continue;
- if(!is_user_connected(i))
- continue;
- resetRound(i);
- }
- }
- public resetAll(){
- for(new i=0;i<=MAX_PLAYERS;i++)
- {
- if(is_user_hltv(i))
- continue;
- if(!is_user_connected(i))
- continue;
- reset(i);
- }
- }
- public onEndRound(){
- if(get_pcvar_num(g_cvarEndShow))
- set_task(0.3,"podsumowanie");
- }
- public podsumowanie()
- {
- new bool:double=false;
- new id=0;
- for(new i=1;i<=MAX_PLAYERS;i++)
- {
- if(is_user_hltv(i))
- continue;
- if(!is_user_connected(i))
- continue;
- if(g_pointsThisRound[id][0]==g_pointsThisRound[i][0]){
- if(g_pointsThisRound[id][1] == g_pointsThisRound[i][1]){
- double=true;
- }
- else if(g_pointsThisRound[id][1] < g_pointsThisRound[i][1]){
- id=i;
- double=false;
- }
- }
- else if(g_pointsThisRound[id][0] < g_pointsThisRound[i][0]){
- id=i;
- double=false;
- }
- }
- if(!double && id)
- {
- new szNick[33];
- get_user_name(id,szNick,32);
- set_dhudmessage(0, 255, 0, -1.0, 0.2, 0, 5.0, 5.0, 0.8, 0.1);
- for(new i=0; i < 33; i++)
- if(is_user_connected(i))
- if(!is_user_hltv(i))
- show_dhudmessage(i, "[MVP]^x01 Zdobyl %s majac %d zabic w tym %d HS",szNick,g_pointsThisRound[id][0],g_pointsThisRound[id][1]);
- }
- }
- public client_putinserver(id){
- reset(id);
- resetRound(id);
- }
- public client_disconnect(id){
- reset(id);
- resetRound(id);
- }
- public onDeath(){
- new kid=read_data(1);
- new vid=read_data(2);
- if(is_user_hltv(kid))
- return PLUGIN_HANDLED;
- if(is_user_hltv(vid))
- return PLUGIN_HANDLED;
- if(!is_user_connected(kid)){
- reset(vid);
- return PLUGIN_CONTINUE;
- }
- g_points[kid][0]++;
- g_pointsThisRound[kid][0]++;
- if(read_data(3)){
- g_points[kid][1]++;
- g_pointsThisRound[kid][1]++;
- }
- reset(vid);
- return PLUGIN_CONTINUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement