Raised This Month: $ Target: $400
 0% 

Hepl me in my new plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-05-2014 , 10:28   Re: Hepl me in my new plugin
Reply With Quote #11

You have to check which team they belong to so you know whether they won or lost.

This will print:

Your team has won the round!
Your team has lost the round!

for everyone if the terrorists win and

Your team has lost the round!
Your team has won the round!

if the CTs win.
__________________

Last edited by Black Rose; 04-05-2014 at 10:28.
Black Rose is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-05-2014 , 10:32   Re: Hepl me in my new plugin
Reply With Quote #12

This, thanks rose.

Code:
WAIT
__________________
Like my clean plugins and work?

Last edited by Baws; 04-05-2014 at 10:34.
Baws is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-05-2014 , 10:36   Re: Hepl me in my new plugin
Reply With Quote #13

There are a lot more messages sent through TextMsg apart from those 2. There are also more teams than t & ct.
The logic has to be like this
Code:
if ( TxtMsg == terror win ) {  if ( team == t ) {}  else if ( team == ct ) {} } else if ( TxtMsg == ct win ) {  if ( team == t ) {}  else if ( team == ct ) {} }
To avoid 2 calls to the team function, save it in a variable.
__________________

Last edited by Black Rose; 04-05-2014 at 10:55.
Black Rose is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 04-05-2014 , 10:42   Re: Hepl me in my new plugin
Reply With Quote #14

@baws
When will you learn? Stop posting your garbage.

PHP Code:
#include < amxmodx > 
#include < amxmisc > 

#define PLUGIN "Idk it's yours lol" 
#define VERSION "1.0" 
#define AUTHOR "Arrow123" 

public plugin_init( ) 

    
register_pluginPLUGINVERSIONAUTHOR 
    
register_messageget_user_msgid"TextMsg" ), "iTextMessage" ); 


public 
iTextMessageid )

    static 
iTextMsg33 ]; 
    
get_msg_arg_string2iTextMsgcharsmaxiTextMsg ) ); 
     
     
    if(
equal(iTextMsg"#Terrorists_Win")) 
        
client_printidprint_chat"Your team has won the round!" )
    else
        
client_printidprint_chat"Your team has lost the round!" )
     
    if(
equal(iTextMsg"#CTs_Win")) 
        
client_printidprint_chat"Your team has won the round!" )
    else
        
client_printidprint_chat"Your team has lost the round!" )
     
    return 
PLUGIN_CONTINUE

and this

PHP Code:
#include < amxmodx > 
#include < amxmisc >
#include < cstrike >

#define PLUGIN "Idk it's yours lol" 
#define VERSION "1.0" 
#define AUTHOR "Arrow123" 

public plugin_init( ) 

    
register_pluginPLUGINVERSIONAUTHOR 
    
register_messageget_user_msgid"TextMsg" ), "iTextMessage" ); 


public 
iTextMessageid )

    static 
iTextMsg33 ]; 
    
get_msg_arg_string2iTextMsgcharsmaxiTextMsg ) ); 
     
     
    if( 
equaliTextMsg"#Terrorists_Win" ) || cs_get_user_teamid ) == CS_TEAM_T 
        
client_printidprint_chat"Your team has won the round!" )
    else
        
client_printidprint_chat"Your team has lost the round!" )
     
    if( 
equaliTextMsg"#CTs_Win" ) || cs_get_user_teamid ) == CS_TEAM_CT )
        
client_printidprint_chat"Your team has won the round!" )
    else
        
client_printidprint_chat"Your team has lost the round!" )
     
    return 
PLUGIN_CONTINUE

Quote:
Originally Posted by fysiks View Post
STOP GIVING BAD ADVICE! It's clear that you are not learning. I've already told you to test the suggestions that you make BEFORE you suggest them.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 04-05-2014 at 10:44.
wickedd is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-05-2014 , 10:43   Re: Hepl me in my new plugin
Reply With Quote #15

This one:

Code:
#include < amxmodx > #include < amxmisc > #include < cstrike > #define PLUGIN "Idk it's yours lol" #define VERSION "1.0" #define AUTHOR "Arrow123" public plugin_init( ) {     register_plugin( PLUGIN, VERSION, AUTHOR )     register_message( get_user_msgid( "TextMsg" ), "iTextMessage" ); } public iTextMessage( id ) {     static iTextMsg[ 33 ];     get_msg_arg_string( 2, iTextMsg, charsmax( iTextMsg ) );         if( equal( iTextMsg, "#Terrorists_Win" ) )     {         if( cs_get_user_team( id ) == CS_TEAM_T )             client_print( id, print_chat, "Your team has won the round!" )         else if( cs_get_user_team( id ) == CS_TEAM_CT )             client_print( id, print_chat, "Your team has lost the round!" )     }         else if( equal( iTextMsg, "#CTs_Win" ) )     {         if( cs_get_user_team( id ) == CS_TEAM_CT )             client_print( id, print_chat, "Your team has won the round!" )         else if( cs_get_user_team( id ) == CS_TEAM_T )             client_print( id, print_chat, "Your team has lost the round!" )     }           return PLUGIN_CONTINUE; }

Hope this will help you.
__________________
Like my clean plugins and work?

Last edited by Baws; 04-05-2014 at 10:44.
Baws is offline
Arrow123
Member
Join Date: Apr 2014
Location: India
Old 04-06-2014 , 04:43   Re: Hepl me in my new plugin
Reply With Quote #16

Thxx all Who help me i finally made my first plugin.
You all are so helpful thankyou so much.
__________________
There is nothing to see here..
Arrow123 is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-06-2014 , 10:34   Re: Hepl me in my new plugin
Reply With Quote #17

No problem!
__________________
Like my clean plugins and work?
Baws is offline
Arrow123
Member
Join Date: Apr 2014
Location: India
Old 04-06-2014 , 10:43   Re: Hepl me in my new plugin
Reply With Quote #18

Last thing m asking as it gives bug in my plugin..
wat does ispec==1,2... means??[numbers]
__________________
There is nothing to see here..
Arrow123 is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-06-2014 , 10:48   Re: Hepl me in my new plugin
Reply With Quote #19

What do you mean? [ If it's a code in your plugin, just show the part of the code maybe it will help ]

Or are you talking about strings, variables?
If so look here: https://forums.alliedmods.net/showth...=94381?t=94381
__________________
Like my clean plugins and work?
Baws 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 01:16.


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