Raised This Month: $ Target: $400
 0% 

can anyone help me....plz


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
martins
Junior Member
Join Date: Sep 2005
Old 03-09-2006 , 17:08   can anyone help me....plz
Reply With Quote #1

i just edit a plugin called sameipsameteam
i made it but it can not work...can you help me??thx...here is the code
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Same IP Same Team"
#define VERSION "1.0"
#define AUTHOR "martins"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("amx_sameIPsameTeam","1")
	register_logevent( "Event_RoundStart", 2, "0=World triggered", "1=Round_Start" )
	return PLUGIN_CONTINUE
}
public Event_RoundStart(){
	
	if((get_cvar_num("amx_sameipsameteam") == 1)){
		

	new players[32],ip[32][32],name[32][32]
	new playerscount,total_count = 0,ct_count = 0,t_count = 1,m=0,n
	get_players(players,playerscount,"c")	
	for( new i = 0 ; i <playerscount ; i++) {
		get_user_ip(players[i],ip[i],31) //get IP
		console_print(0,"ip[ %i ] is %s",i,ip[i])
	}
	for (new a = 0;a<playerscount;a++){ //get IP[a] from 1 to x
		for (new b = a+1;b<playerscount;b++){  //get ip[b] from 2 to x
			if (equali(ip[a],ip[b])) { //ip is same
			n = a
			get_user_name(players[b],name[m],31)
			m = m + 1
			total_count = total_count + 1
		}
		}
	get_user_name(players[n],name[m],31)
	for(new j=0;j<=m;j++){
		new aa = get_user_index(name[j])
		new CsTeams:userTeam = cs_get_user_team(players[aa])
		if (userTeam == CS_TEAM_CT) {
			ct_count = ct_count + 1
		}
		else if (userTeam == CS_TEAM_T){
			t_count = t_count + 1
		}
	}
	if (ct_count >= t_count){	
		for(new x=0;x<=m;x++){
			new bb = get_user_index(name[x])
			cs_set_user_team(bb,2)
			client_print(0,print_chat,"players %s change team for same ip: %s",name[x],ip[n])
		}
		}else{
		for(new y=0;y<=m;y++){
			new cc = get_user_index(name[y])
			cs_set_user_team(cc,1)
			client_print(0,print_chat,"players %s change team for same ip: %s",name[y],ip[n])
		}
	}
	
}
}
return PLUGIN_HANDLED
}
martins is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-09-2006 , 17:15   Re: can anyone help me....plz
Reply With Quote #2

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Same IP Same Team" #define VERSION "1.0" #define AUTHOR "martins" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_sameIPsameTeam","1")     register_logevent( "Event_RoundStart", 2, "0=World triggered", "1=Round_Start" )     } public Event_RoundStart(){         if((get_cvar_num("amx_sameipsameteam") == 1)){                new players[32],ip[32][32],name[32][32]        new playerscount,total_count = 0,ct_count = 0,t_count = 1,m=0,n        get_players(players,playerscount,"c")           for( new i = 0 ; i <playerscount ; i++) {         get_user_ip(players[i],ip[i],31) //get IP         console_print(0,"ip[ %i ] is %s",i,ip[i])        }        for (new a = 0;a<playerscount;a++){ //get IP[a] from 1 to x         for (new b = a+1;b<playerscount;b++){  //get ip[b] from 2 to x             if (equali(ip[a],ip[b])) { //ip is same                n = a                get_user_name(players[b],name[m],31)                m = m + 1                total_count = total_count + 1                }        }        get_user_name(players[n],name[m],31)        for(new j=0;j<=m;j++){         new aa = get_user_index(name[j])         new CsTeams:userTeam = cs_get_user_team(players[aa])         if (userTeam == CS_TEAM_CT) {             ct_count = ct_count + 1         }         else if (userTeam == CS_TEAM_T){             t_count = t_count + 1         }        }        if (ct_count >= t_count){            for(new x=0;x<=m;x++){             new bb = get_user_index(name[x])             cs_set_user_team(bb,2)             client_print(0,print_chat,"players %s change team for same ip: %s",name[x],ip[n])        }        }else{         for(new y=0;y<=m;y++){             new cc = get_user_index(name[y])             cs_set_user_team(cc,1)             client_print(0,print_chat,"players %s change team for same ip: %s",name[y],ip[n])              }        }       }     return PLUGIN_HANDLED }
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
martins
Junior Member
Join Date: Sep 2005
Old 03-09-2006 , 17:20  
Reply With Quote #3

no...it can not work...[/quote]
martins is offline
martins
Junior Member
Join Date: Sep 2005
Old 03-09-2006 , 17:22  
Reply With Quote #4

perhaps any wrong with it......but i can not find out...
martins is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-09-2006 , 17:22  
Reply With Quote #5

Edit: Try my updated version
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
martins
Junior Member
Join Date: Sep 2005
Old 03-09-2006 , 17:24  
Reply With Quote #6

HERE IS THE ERRORS:
L 03/10/2006 - 06:118: [CSTRIKE] Player out of range (0)
L 03/10/2006 - 06:118: [AMXX] Displaying debug trace (plugin "sameIPsameTeam.a
mxx")
L 03/10/2006 - 06:118: [AMXX] Run time error 10: native error (native "cs_get_
user_team")
L 03/10/2006 - 06:118: [AMXX] [0] sameIPsameTeam.sma::Event_RoundStart (lin
e 42)
martins is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-09-2006 , 17:27  
Reply With Quote #7

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Same IP Same Team" #define VERSION "1.0" #define AUTHOR "martins" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_sameIPsameTeam","1")     register_event ( "RoundStart", "Event_RoundStart", "a" )     } public Event_RoundStart(){         if((get_cvar_num("amx_sameipsameteam") == 1)){                new players[32],ip[32][32],name[32][32]        new playerscount,total_count = 0,ct_count = 0,t_count = 1,m=0,n        get_players(players,playerscount,"c")            for( new i = 0 ; i <playerscount ; i++) {         get_user_ip(players[i],ip[i],31) //get IP         console_print(0,"ip[ %i ] is %s",i,ip[i])        }        for (new a = 0;a<playerscount;a++){ //get IP[a] from 1 to x         for (new b = a+1;b<playerscount;b++){  //get ip[b] from 2 to x             if (equali(ip[a],ip[b])) { //ip is same                n = a                get_user_name(players[b],name[m],31)                m = m + 1                total_count = total_count + 1                }        }        get_user_name(players[n],name[m],31)        for(new j=0;j<=m;j++){         new aa = get_user_index(name[j])         new CsTeams:userTeam = cs_get_user_team(players[aa])         if (userTeam == CS_TEAM_CT) {             ct_count = ct_count + 1         }         else if (userTeam == CS_TEAM_T){             t_count = t_count + 1         }        }        if (ct_count >= t_count){             for(new x=0;x<=m;x++){             new bb = get_user_index(name[x])             cs_set_user_team(bb,2)             client_print(0,print_chat,"players %s change team for same ip: %s",name[x],ip[n])        }        }else{         for(new y=0;y<=m;y++){             new cc = get_user_index(name[y])             cs_set_user_team(cc,1)             client_print(0,print_chat,"players %s change team for same ip: %s",name[y],ip[n])              }        }       }     return PLUGIN_HANDLED }

That may be an invalid event, don't do a lot of CS scripting, let me check
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
martins
Junior Member
Join Date: Sep 2005
Old 03-09-2006 , 17:28  
Reply With Quote #8

thx a lot first...
martins is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-09-2006 , 17:37  
Reply With Quote #9

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "Same IP Same Team" #define VERSION "1.0" #define AUTHOR "martins" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_cvar("amx_sameIPsameTeam","1")      register_event("HLTV" , "Event_RoundStart" , "a" , "1=0" , "2=0");       } public Event_RoundStart(){         if((get_cvar_num("amx_sameipsameteam") == 1)){                new players[32],ip[32][32],name[32][32]        new playerscount,total_count = 0,ct_count = 0,t_count = 1,m=0,n        get_players(players,playerscount,"c")            for( new i = 0 ; i <playerscount ; i++) {         get_user_ip(players[i],ip[i],31) //get IP         console_print(0,"ip[ %i ] is %s",i,ip[i])        }        for (new a = 0;a<playerscount;a++){ //get IP[a] from 1 to x         for (new b = a+1;b<playerscount;b++){  //get ip[b] from 2 to x             if (equali(ip[a],ip[b])) { //ip is same                n = a                get_user_name(players[b],name[m],31)                m = m + 1                total_count = total_count + 1                }        }        get_user_name(players[n],name[m],31)        for(new j=0;j<=m;j++){         new aa = get_user_index(name[j])         new CsTeams:userTeam = cs_get_user_team(players[aa])         if (userTeam == CS_TEAM_CT) {             ct_count = ct_count + 1         }         else if (userTeam == CS_TEAM_T){             t_count = t_count + 1         }        }        if (ct_count >= t_count){             for(new x=0;x<=m;x++){             new bb = get_user_index(name[x])             cs_set_user_team(bb,2)             client_print(0,print_chat,"players %s change team for same ip: %s",name[x],ip[n])        }        }else{         for(new y=0;y<=m;y++){             new cc = get_user_index(name[y])             cs_set_user_team(cc,1)             client_print(0,print_chat,"players %s change team for same ip: %s",name[y],ip[n])              }        }       }     return PLUGIN_HANDLED }
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
martins
Junior Member
Join Date: Sep 2005
Old 03-09-2006 , 17:45  
Reply With Quote #10

thx.i'll try immediately....
martins is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode