Raised This Month: $12 Target: $400
 3% 

Plaflag board


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yRestrict
BANNED
Join Date: Apr 2019
Old 02-05-2020 , 06:04   Plaflag board
Reply With Quote #1

I have a problem with this plugin,
sometimes he makes the wrong quote other times he disappears from the HUD could someone help me solve this problem
it and plate that counts how many flag were taken

PHP Code:
// Includes
#include <  amxmodx >
#include <   jctf   >

// Team
new score_Team];

// Team ( jCTF )
enum
{
    
TEAM_NONE 0,
    
TEAM_RED,
    
TEAM_BLUE,
    
TEAM_SPEC
}

public 
plugin_init( )
{
    
register_plugin"Placar""0.0.1""Developer" );

    
// Register TextMsg
    
register_event"TextMsg""event_TextMsg""a""2&#Game_C""2&#Game_w""2&#Game_will_restart_in" );

    
// Task HUD
    
set_task1.0"scoreFlag"___"b" );
}

public 
event_TextMsg( )
    
set_task3.0"taskReset" );

public 
taskReset( )
{
    
score_Team] = 0;
    
score_Team] = 0;
}

public 
jctf_flagevidtm )
{
    if( 
ev == FLAG_CAPTURED && tm == TEAM_RED )
        
score_Team] += 1;
    
    if( 
ev == FLAG_CAPTURED && tm == TEAM_BLUE )
        
score_Team] += 1;
}

public 
scoreFlag( )
{
    
set_dhudmessage255255255, -1.00.000.01.10.00.0 )
    
show_dhudmessage0"[TR] VS [CT]^n[%d] -- [%d]"score_Team], score_Team] )

yRestrict is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-05-2020 , 07:47   Re: Plaflag board
Reply With Quote #2

Untested

PHP Code:
// Includes
#include <  amxmodx >
#include <   jctf   >

enum Teams
{
    
TEAM_NONE 0,
    
TEAM_RED,
    
TEAM_BLUE,
    
TEAM_SPEC
}

new 
score_TeamTeams ];

public 
plugin_init( )
{
    
register_plugin"Placar""0.0.1""Developer" );

    
// Register TextMsg
    
register_event"TextMsg""event_TextMsg""a""2&#Game_C""2&#Game_w""2&#Game_will_restart_in" );

    
// Task HUD
    
set_task1.0"scoreFlag"___"b" );
}

public 
event_TextMsg( )
    
set_task3.0"taskReset" );

public 
taskReset( )
{
    
score_TeamTEAM_RED ] = 0;
    
score_TeamTEAM_BLUE ] = 0;
}

public 
jctf_flagev id tm )
{
    if( 
ev == FLAG_CAPTURED )
        
score_TeamTeams:tm ] += 1;
}

public 
scoreFlag( )
{
    
set_dhudmessage255255255, -1.00.000.01.10.00.0 )
    
show_dhudmessage0"[TR] VS [CT]^n[%d] -- [%d]"score_TeamTEAM_RED ], score_TeamTEAM_BLUE ] )

__________________

Last edited by Bugsy; 02-07-2020 at 17:39.
Bugsy is offline
yRestrict
BANNED
Join Date: Apr 2019
Old 02-06-2020 , 20:35   Re: Placa plaflag
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Untested

PHP Code:
// Includes
#include <  amxmodx >
#include <   jctf   >

enum Teams
{
    
TEAM_NONE 0,
    
TEAM_RED,
    
TEAM_BLUE,
    
TEAM_SPEC
}

new 
score_TeamTeams ];

public 
plugin_init( )
{
    
register_plugin"Placar""0.0.1""Developer" );

    
// Register TextMsg
    
register_event"TextMsg""event_TextMsg""a""2&#Game_C""2&#Game_w""2&#Game_will_restart_in" );

    
// Task HUD
    
set_task1.0"scoreFlag"___"b" );
}

public 
event_TextMsg( )
    
set_task3.0"taskReset" );

public 
taskReset( )
{
    
score_TeamTEAM_RED ] = 0;
    
score_TeamTEAM_BLUE ] = 0;
}

public 
jctf_flagevidtm )
{
    if( 
ev == FLAG_CAPTURED && tm == TEAM_RED )
        
score_TeamTEAM_RED ] += 1;
    
    if( 
ev == FLAG_CAPTURED && tm == TEAM_BLUE )
        
score_TeamTEAM_BLUE ] += 1;
}

public 
scoreFlag( )
{
    
set_dhudmessage255255255, -1.00.000.01.10.00.0 )
    
show_dhudmessage0"[TR] VS [CT]^n[%d] -- [%d]"score_TeamTEAM_RED ], score_TeamTEAM_BLUE ] )

===== c:\Users\maxtr\Downloads\Placar_1.sma =====
WARNING [37]: tag mismatch
WARNING [40]: tag mismatch
yRestrict is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-07-2020 , 06:45   Re: Plaflag board
Reply With Quote #4

I fixed the above code
__________________
Bugsy is offline
yRestrict
BANNED
Join Date: Apr 2019
Old 02-07-2020 , 09:44   Re: Placa plaflag
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
I fixed the above code
but every time I try to compile it from this error how do I fix it?
yRestrict is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-07-2020 , 10:13   Re: Plaflag board
Reply With Quote #6

I didn't test compile since I'm on my phone. Do you get the same warning when compiling the revised code? If so I'll take a look later when I get home.
__________________
Bugsy is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 02-07-2020 , 10:59   Re: Plaflag board
Reply With Quote #7

PHP Code:
public jctf_flagevidtm )
{
    if( 
ev == FLAG_CAPTURED)
    {
        switch(
tm)
        {   
            case 
TEAM_REDscore_TeamTEAM_RED ] ++;
            case 
TEAM_BLUEscore_TeamTEAM_BLUE] ++;
        }
    }

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 02-07-2020 at 19:44.
iceeedr is offline
Send a message via Skype™ to iceeedr
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-07-2020 , 11:34   Re: Plaflag board
Reply With Quote #8

Not necessary to use a switch when you can pass team directly to the array as I did.
__________________
Bugsy is offline
yRestrict
BANNED
Join Date: Apr 2019
Old 02-07-2020 , 14:41   Re: Plaflag board
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
I didn't test compile since I'm on my phone. Do you get the same warning when compiling the revised code? If so I'll take a look later when I get home.
that's right, I'm not able to compile plugin

Last edited by yRestrict; 02-07-2020 at 14:42.
yRestrict is offline
yRestrict
BANNED
Join Date: Apr 2019
Old 02-07-2020 , 16:00   Re: Plaflag board
Reply With Quote #10

Quote:
Originally Posted by iceeedr View Post
PHP Code:
public jctf_flagevidtm )
{
    if( 
ev == FLAG_CAPTURED)
    {
        switch(
tm)
        {   
            case 
TEAM_REDscore_TeamTEAM_RED ] ++;
            case 
TEAM_BLUEscore_TeamTEAM_RED ] ++;
        }
    }

I just made a short text using the code icedr compiled right, the sign stopped disappearing, but now it doesn't count for team CT
yRestrict is offline
Reply


Thread Tools
Display Modes

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 06:00.


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