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

How to make when player is not admin normal chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 03-17-2012 , 16:53   How to make when player is not admin normal chat
Reply With Quote #1

Hellol anyone help how to make when Player is not admin can not tag and your chat to be Normal by team and your message normal

PHP Code:
public Say_Handle(id)
{
    if(
FlagaGracza[id] == 0)
        return 
PLUGIN_CONTINUE
    
    
new message[192]
    
read_args(message191)
    
remove_quotes(message)
    
    if(
message[0] == '@' || message[0] == '!' || equal(message""))
        return 
PLUGIN_CONTINUE
        
    Wyslij_Wiadomosc
(idmessage1)
    return 
PLUGIN_HANDLED
}

public 
SayTeam_Handle(id)
{
    
SprawdzFlagi(id)
    if(
FlagaGracza[id] == 0)
        return 
PLUGIN_CONTINUE
    
    
new message[192]
    
read_args(message191)
    
remove_quotes(message)
    
    if(
message[0] == '@' || message[0] == '!' || equal(message""))
        return 
PLUGIN_CONTINUE
        
    Wyslij_Wiadomosc
(idmessage2)
    return 
PLUGIN_HANDLED
}

public 
Wyslij_Wiadomosc(idmessage[192], mode)
{
    new 
nick[32], info[3][64]
    
get_user_name(idnick31)
    
    new 
kolor 0
    
    
switch(get_user_team(id)){
        case 
1: { kolor 3formatex(info[0], 63"(Terrorists) "); formatex(info[1], 63"*DEAD* "); formatex(info[2], 63"%s(Terrorists) ""*DEAD* ");}
        case 
2: { kolor 3formatex(info[0], 63"(Counter-Terrorists) "); formatex(info[1], 63"*DEAD* "); formatex(info[2], 63"%s(Counter-Terrorists) ""*DEAD* ");}
        default: { 
kolor 3formatex(info[0], 63"(Spectators) "); formatex(info[1], 63"*SPEC* "); formatex(info[2], 63"%s (Spectators) ""*DEAD*");}
    }
    
    switch(
mode)
    {
        case 
1:{
            
ColorChat(0kolor"^x01%s^x03[%s] ^x04%s^x01: ^x03%s"is_user_alive(id) ? "":info[1], Tagi[FlagaGracza[id] - 1], nickmessage)
        }
        case 
2: {
            
ColorChat(0kolor"^x01%s^x03[%s] ^x04%s^x01: ^x03%s"is_user_alive(id) ? info[0]:info[2], Tagi[FlagaGracza[id] - 1], nickmessage)
        }
    }

Ant1Lamer is offline
brian201049
Member
Join Date: Mar 2011
Location: Hong Kong
Old 03-17-2012 , 17:57   Re: How to make when player is not admin normal chat
Reply With Quote #2

edit adminchat.sma
brian201049 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-17-2012 , 19:16   Re: How to make when player is not admin normal chat
Reply With Quote #3

return PLUGIN_CONTINUE if player is not an admin (!is_user_admin())

Quote:
Originally Posted by brian201049 View Post
edit adminchat.sma
no.
__________________
fysiks is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 03-17-2012 , 20:16   Re: How to make when player is not admin normal chat
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
return PLUGIN_CONTINUE if player is not an admin (!is_user_admin())



no.
thanks but i don't understand how to make ? how to edit for to become
Ant1Lamer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-18-2012 , 01:50   Re: How to make when player is not admin normal chat
Reply With Quote #5

Quote:
Originally Posted by Ant1Lamer View Post
thanks but i don't understand how to make ? how to edit for to become
Put this at the beginning of each chat function (I don't know what that third functions is):

PHP Code:
if( !is_user_admin(id) )
{
    return 
PLUGIN_CONTINUE

There are ways to optimize but that would require doing all the work for you.
__________________
fysiks is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 03-18-2012 , 11:02   Re: How to make when player is not admin normal chat
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Put this at the beginning of each chat function (I don't know what that third functions is):

PHP Code:
if( !is_user_admin(id) )
{
    return 
PLUGIN_CONTINUE

There are ways to optimize but that would require doing all the work for you.
hmm i try but not work i dont understand why... ? can you make please and give the code
Ant1Lamer is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 03-18-2012 , 11:03   Re: How to make when player is not admin normal chat
Reply With Quote #7

ant1lamer send ur full script please.
Bilal Pro is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 03-18-2012 , 14:27   Re: How to make when player is not admin normal chat
Reply With Quote #8

PHP Code:
public client_connect(id)
{
    
set_task(1.0"SprawdzFlagi"id)
    return 
PLUGIN_CONTINUE
}

public 
client_infochanged(id)
{
    new 
newname[32], oldname[32]
    
get_user_info(id"name"newname31)
    
get_user_name(idoldname31)
    if(!
equal(newnameoldname)){
        
set_task(0.1"SprawdzFlagi"id)
    }
}

public 
WczytajTagi(config_file[64])
{
    new 
Plik fopen(config_file"r");
    
    if(
Plik)
    {
        new 
Text[64]
        new 
Tags[33]
        new 
Flags[33]
        
        while(!
feof(Plik))
        {
            
fgets(PlikTextsizeof(Text)-1)
            
trim(Text)
            
parse(TextTags32Flags32)
            if(
equali(Text"")) { break; TagCount++; }
            
copy(Tagi[TagCount], 32Tags)
            
copy(Flagi[TagCount], 32Flags)
            
TagCount++
        }
        
fclose(Plik)
    }
    
    if(
TagCount 0){
        for(new 
i=0i<TagCounti++){
            
log_amx("[AdminTag] LOADED: Tag: %s | Flagi: %s |"Tagi[i], Flagi[i])
        }
    } else {
        
log_amx("[AdminTag] Nie znaleziono zadnych tagow!")
    }
}

public 
Say_Handle(id)
{
    if(
FlagaGracza[id] == 0)
        return 
PLUGIN_CONTINUE
    
    
new message[192]
    
read_args(message191)
    
remove_quotes(message)
    
    if(
message[0] == '@' || message[0] == '!' || equal(message""))
        return 
PLUGIN_CONTINUE
        
    Wyslij_Wiadomosc
(idmessage1)
    return 
PLUGIN_HANDLED
}

public 
SayTeam_Handle(id)
{
    
SprawdzFlagi(id)
    if(
FlagaGracza[id] == 0)
        return 
PLUGIN_CONTINUE
    
    
new message[192]
    
read_args(message191)
    
remove_quotes(message)
    
    if(
message[0] == '@' || message[0] == '!' || equal(message""))
        return 
PLUGIN_CONTINUE
        
    Wyslij_Wiadomosc
(idmessage2)
    return 
PLUGIN_HANDLED
}

public 
Wyslij_Wiadomosc(idmessage[192], mode)
{
    new 
nick[32], info[3][64]
    
get_user_name(idnick31)
    
    new 
kolor 0
    
    
switch(get_user_team(id)){
        case 
1: { kolor 3formatex(info[0], 63"(Terrorists) "); formatex(info[1], 63"*DEAD* "); formatex(info[2], 63"%s(Terrorists) ""*DEAD* ");}
        case 
2: { kolor 3formatex(info[0], 63"(Counter-Terrorists) "); formatex(info[1], 63"*DEAD* "); formatex(info[2], 63"%s(Counter-Terrorists) ""*DEAD* ");}
        default: { 
kolor 3formatex(info[0], 63"(Spectators) "); formatex(info[1], 63"*SPEC* "); formatex(info[2], 63"%s (Spectators) ""*DEAD*");}
    }
    
    switch(
mode)
    {
        case 
1:{
            
ColorChat(0kolor"^x01%s^x03[%s] ^x04%s^x01: ^x03%s"is_user_alive(id) ? "":info[1], Tagi[FlagaGracza[id] - 1], nickmessage)
        }
        case 
2: {
            
ColorChat(0kolor"^x01%s^x03[%s] ^x04%s^x01: ^x03%s"is_user_alive(id) ? info[0]:info[2], Tagi[FlagaGracza[id] - 1], nickmessage)
        }
    }
}

public 
SprawdzFlagi(id)
{
    for(new 
i=TagCounti>0i--)
    {
        if(
get_user_flags(id) && read_flags(Flagi[i])){
            
FlagaGracza[id]=i
        
}
    }


Last edited by Ant1Lamer; 03-18-2012 at 14:30.
Ant1Lamer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-18-2012 , 14:28   Re: How to make when player is not admin normal chat
Reply With Quote #9

Where is my suggestion in your code?
__________________

Last edited by fysiks; 03-18-2012 at 14:28.
fysiks is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 03-18-2012 , 15:29   Re: How to make when player is not admin normal chat
Reply With Quote #10

nowhere i don't know where to put this function try it but didnt happen
Ant1Lamer 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 17:57.


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