Raised This Month: $ Target: $400
 0% 

Help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maladca
Junior Member
Join Date: Mar 2014
Old 04-02-2014 , 13:55   Help!
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <csstats>
#include <hamsandwich>

#define IGNORE_FLAG ADMIN_LEVEL_A    /* flag "m" */

new pRanks,
    
pFlags,
    
pFrags,
    
pChatRanks,
    
pChatFlags,
    
pChatFrags;

public 
plugin_init() {
    
register_plugin("Test""0.11c""Test")
    
    
pRanks register_cvar("top_ranks""10");
    
pFlags register_cvar("top_flags""t");
    
pFrags register_cvar("top_frags""1000");
    
    
pChatRanks register_cvar("top_chat_ranks""10");
    
pChatFlags register_cvar("top_chat_flags""i");
    
pChatFrags register_cvar("top_chat_frags""300");
    
    
register_event("HLTV""eventNewRound""a""1=0""2=0");
    
    
RegisterHam(Ham_Killed"player""fwdKilled"1);
}

public 
fwdKilled(idkiller)
    
CheckStats(id);

public 
client_putinserver(id)
    
set_task(0.3"CheckStats"id);

public 
CheckStats(id) {
    
    static 
szAddFlags[16], Stats[8], BodyHits[8];
    
    new 
iFlags get_user_flags(id);
    if ( 
iFlags IGNORE_FLAG )
        return;
    
    new 
iRanks get_pcvar_num(pRanks);
    new 
iRank get_user_stats(idStatsBodyHits);
    
    if ( ( 
iRanks && iRank && iRank <= iRanks ) || Stats[0] >= get_pcvar_num(pFrags) ) {
        
get_pcvar_string(pFlagsszAddFlagscharsmax(szAddFlags));
        
set_user_flags(idread_flags(szAddFlags))
        
set_task(5.0"PrintMessage2"id)
    }
    
    
iRanks get_pcvar_num(pChatRanks);
    
    if ( ( 
iRanks && iRank && iRank <= iRanks ) || Stats[0] >= get_pcvar_num(pChatFrags) ) {
        
get_pcvar_string(pChatFlagsszAddFlagscharsmax(szAddFlags));
        
set_user_flags(idread_flags(szAddFlags))
        
set_task(5.0"PrintMessage2"id)
    }
}

public 
PrintMessage(id) {
    if ( ! 
is_user_connected(id) )
        return;
    
    
ColorPrint(id"You got admin");
}

public 
PrintMessage2(id) {
    if ( ! 
is_user_connected(id) )
        return;
    
    
ColorPrint(id"You got admin chat");
}

public 
eventNewRound()
    
set_task(2.0"delayedMessage");

public 
delayedMessage() {
    
    new 
players[32], playersnum;
    
get_players(playersplayersnum"ch");
    
    new 
Stats[8], BodyHits[8];
    new 
iFrags get_pcvar_num(pFrags);
    
    for ( new 
playersnum i++ ) {
        
get_user_stats(players[i], StatsBodyHits);
        if ( 
Stats[0] < iFrags )
            
ColorPrint(players[i], "Your frags are %d, after %d frags you get admin"Stats[0], iFrags);
    }
}

ColorPrintiReceiver, const szRawMessage[ ], any:... ) {
    
    static 
iMsgSayText;
    
    if( ! 
iMsgSayText )
        
iMsgSayText get_user_msgid("SayText");

    new 
szMessage[192] = "^1";
    
vformat(szMessagecharsmax(szMessage) - 1szRawMessage3);
    
    
replace_all(szMessage[1], charsmax(szMessage) - 1"!n""^1");
    
replace_all(szMessage[1], charsmax(szMessage) - 1"!t""^3");
    
replace_all(szMessage[1], charsmax(szMessage) - 1"!g""^4");

    
message_begin(MSG_ONE_UNRELIABLEiMsgSayText_iReceiver);
    
write_byte(iReceiver);
    
write_string(szMessage);
    
message_end();

The player scored 300 kills and it just displays a message and admin chat he does not. And about 1000 frags there is no result at all! There's even a message does not issue! Help.
Maladca is online now
Maladca is offline
Old 04-03-2014, 15:44
Maladca
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Old 04-04-2014, 15:42
Maladca
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
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 06:04.


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