Raised This Month: $ Target: $400
 0% 

Terrorist Win


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-09-2010 , 13:34   Terrorist Win
Reply With Quote #1

Hi,

I wanna make a script , like when a terrorist wins , ex:

register_logevent( "EventRoundEnd", 2. "Round_End" )

if(Terrorists win)
{
// my script
}

I wanna do this at round end ... thats why i added the register_logevent so you understand
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-09-2010 , 13:47   Re: Terrorist Win
Reply With Quote #2

OH WAIT A SECOND ... sory sorry ignore the round end thing ... since if cts or Ts win .. that wont be counted as round end -.-

Edit:
PHP Code:
register_event("SendAudio""t_win""a""2&%!MRAD_terwin")
register_event("SendAudio""ct_win""a""2&%!MRAD_ctwin"
Is this how i am supposed to do it ... i mean this is how i can get it ... then
public ct_win()
{
// my script
}

IS this right?
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%

Last edited by SaM.ThE.MaN; 10-09-2010 at 15:29.
SaM.ThE.MaN is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-09-2010 , 23:32   Re: Terrorist Win
Reply With Quote #3

y not hook

PHP Code:
register_message(get_user_msgid("TextMsg"),    "msgTextMsg"); 
PHP Code:
public msgTextMsg()
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsg21);
    
    
// T Win
    
if(equal(textmsg"#Terrorists_Win"))
    {
        
// ADD WATEVER FOR T HERE
    
}
    
    
// Ct Win
    
else if(equal(textmsg"#CTs_Win"))
    {    
        
// ADD WATEVER FOR CT HERE
    
}
    
    return 
PLUGIN_CONTINUE;

__________________
JailBreak Mod with Plugin API ( 90% ) Public

Last edited by shuttle_wave; 10-09-2010 at 23:35.
shuttle_wave is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-10-2010 , 03:38   Re: Terrorist Win
Reply With Quote #4

Well ... which one is better?

Edit: I tried using what you gave me ... but can you help me with this problem , If CTS win they get 5000 ... But i get an error ... anyways here is the error and the script :

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "sam"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg"),    "msgTextMsg");
}

public 
msgTextMsg(id)
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsg21);
    
    
// T Win
    
if(equal(textmsg"#Terrorists_Win"))
    {
        
// ADD WATEVER FOR CT HERE
    
}
    
    
// Ct Win
    
else if(equal(textmsg"#CTs_Win"))
    {    
        
cs_set_user_money(idcs_get_user_money(id) + 5000 )
    }
    
    return 
PLUGIN_CONTINUE;

Error:
PHP Code:
L 10/10/2010 12:03:15: [CSTRIKEPlayer out of range (77)
L 10/10/2010 12:03:15: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 10/10/2010 12:03:15: [AMXXRun time error 10native error (native "cs_get_user_money")
L 10/10/2010 12:03:15: [AMXX]    [0Untitled.sma::msgTextMsg (line 30
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%

Last edited by SaM.ThE.MaN; 10-10-2010 at 04:06.
SaM.ThE.MaN is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 10-10-2010 , 04:14   Re: Terrorist Win
Reply With Quote #5

Check is user alive before giving money
reinert is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-10-2010 , 04:58   Re: Terrorist Win
Reply With Quote #6

Quote:
Originally Posted by SaM.ThE.MaN View Post
Well ... which one is better?

Edit: I tried using what you gave me ... but can you help me with this problem , If CTS win they get 5000 ... But i get an error ... anyways here is the error and the script :

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "sam"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg"),    "msgTextMsg");
}

public 
msgTextMsg(id)
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsg21);
    
    
// T Win
    
if(equal(textmsg"#Terrorists_Win"))
    {
        
// ADD WATEVER FOR CT HERE
    
}
    
    
// Ct Win
    
else if(equal(textmsg"#CTs_Win"))
    {    
        
cs_set_user_money(idcs_get_user_money(id) + 5000 )
    }
    
    return 
PLUGIN_CONTINUE;

Error:
PHP Code:
L 10/10/2010 12:03:15: [CSTRIKEPlayer out of range (77)
L 10/10/2010 12:03:15: [AMXXDisplaying debug trace (plugin "Untitled.amxx")
L 10/10/2010 12:03:15: [AMXXRun time error 10native error (native "cs_get_user_money")
L 10/10/2010 12:03:15: [AMXX]    [0Untitled.sma::msgTextMsg (line 30
PHP Code:
public msgTextMsg(id

PHP Code:
public msgTextMsg() 
loop thru the players to give them that money
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-10-2010 , 05:19   Re: Terrorist Win
Reply With Quote #7

PHP Code:
else if(equal(textmsg"#CTs_Win")) 
{     
    new 
iPlayers[MAX_PLAYERS], iNumplayer;
    
get_players(iPlayersiNum"a");

    for(new 
i<= iNumi++)
    {
        
player iPlayers[i];
        
        if(
cs_get_user_team(player) == CS_TEAM_CT)
        {
            
cs_set_user_money(playercs_get_user_money(player) + 5000 );
        }

__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-10-2010 , 07:30   Re: Terrorist Win
Reply With Quote #8

Quote:
Originally Posted by shuttle_wave View Post
PHP Code:
else if(equal(textmsg"#CTs_Win")) 
{     
    new 
iPlayers[MAX_PLAYERS], iNumplayer;
    
get_players(iPlayersiNum"a");

    for(new 
i<= iNumi++)
    {
        
player iPlayers[i];
        
        if(
cs_get_user_team(player) == CS_TEAM_CT)
        {
            
cs_set_user_money(playercs_get_user_money(player) + 5000 );
        }

We do this method so msgTextMsg() <-- We do this method cause we dont need id here , Right? So it loops through players ... its that what your doing here..?
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 10-10-2010 , 07:32   Re: Terrorist Win
Reply With Quote #9

Quote:
Originally Posted by SaM.ThE.MaN View Post
We do this method so msgTextMsg() <-- We do this method cause we dont need id here , Right? So it loops through players ... its that what your doing here..?
yes
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-10-2010 , 07:35   Re: Terrorist Win
Reply With Quote #10

alright ... works thank you..
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN 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 10:21.


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