AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   solved. (https://forums.alliedmods.net/showthread.php?t=155734)

EclipseCP 04-26-2011 03:14

solved.
 
hi :)

I have a problem, I add the variable "g_level [id]"to this code, but do not know how to do it...

I want to add before the name

PHP Code:

iLen copy(iMessageiMsgLen"(Zombies) /*Here*/ %s1 : "); 

code: (prochat plugin)

PHP Code:

format_message(iMessage[], const iMsgLen, const iText[]) 

    new 
iHandleReturn[3]; // reutrn = [0]; team = [1]; alive = [2] 

    
if( equal(iMessage"#Cstrike_Name_Change") ) 
    { 

        
copy(iMessageiMsgLen"* %s1 changed name to %s2"); 

        
iHandleReturn[0] = -2
        return 
iHandleReturn

    } 

    new 
iLen;  
    if( 
equal(iMessage"#Cstrike_Chat_CT") ) 
    { 

        
iLen copy(iMessageiMsgLen"(Counter-Terrorist) %s1 : "); 

        
iHandleReturn[1] = 2
        
iHandleReturn[2] = 1

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_T") ) 
    { 
        
iLen copy(iMessageiMsgLen"(Terrorist) %s1 : "); 


        
iHandleReturn[1] = 1
        
iHandleReturn[2] = 1

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_CT_Dead") ) 
    { 
        
iLen copy(iMessageiMsgLen"*DEAD*(Counter-Terrorist) %s1 : "); 

        
iHandleReturn[1] = 2
        
iHandleReturn[2] = 0

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_T_Dead") ) 
    { 
        
iLen copy(iMessageiMsgLen"*DEAD*(Terrorist) %s1 : "); 

        
iHandleReturn[1] = 1
        
iHandleReturn[2] = 0

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_Spec") ) 
    { 
        
iLen copy(iMessageiMsgLen"(Spectator) %s1 : "); 

        
iHandleReturn[1] = 3
        
iHandleReturn[2] = 0

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_All") ) 
    { 
        
iLen copy(iMessageiMsgLen"%s1 : "); 

        
iHandleReturn[1] = 0
        
iHandleReturn[2] = 1

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_AllDead") ) 
    { 
        
iLen copy(iMessageiMsgLen"*DEAD* %s1 : "); 

        
iHandleReturn[1] = 0
        
iHandleReturn[2] = 0

    } 
    else if( 
equal(iMessage"#Cstrike_Chat_AllSpec") ) 
    { 
        
iLen copy(iMessageiMsgLen"*DEAD* %s1 : "); 

        
iHandleReturn[1] = 0
        
iHandleReturn[2] = 0

    } 
    else 
    { 

        
iHandleReturn[0] = PLUGIN_CONTINUE
        return 
iHandleReturn

    } 

    new 
iLen2 = (copy(iMessage[iLen], iMsgLen-iLeniText)-1); // last symbol is 0x10 - dunno what it is, but it dose nothing 
    
if( iLen2<=
    { 

        
iHandleReturn[0] = PLUGIN_HANDLED
        return 
iHandleReturn

    } 

    
iLen2+=iLen
    new 
bool:bWordExists
    for( 
iLen+=0iLen<iLen2iLen++ ) 
    { 
        if( 
iMessage[iLen]=='' || iMessage[iLen]=='' || iMessage[iLen]=='' || iMessage[iLen]=='' || iMessage[iLen]=='%' 
        
iMessage[iLen] = ' '
        else if( 
iMessage[iLen]!=' ' 
        
bWordExists true
    } 

    if( !
bWordExists 
    { 

        
iHandleReturn[0] = PLUGIN_HANDLED
        return 
iHandleReturn

    } 


    
iHandleReturn[0] = -1
    return 
iHandleReturn





All times are GMT -4. The time now is 04:17.

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