AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Health, Armor, money (https://forums.alliedmods.net/showthread.php?t=334840)

Yusochan 10-22-2021 15:30

Health, Armor, money
 
Can u add also a msg when he/she leaves the server ?

PHP Code:

 #include <amxmodx> 
#include <amxmisc> 
#include <cromchat>

new PLUGIN[] = "Welcome Msg"
new VERSION[] = "2.0"
new AUTHOR[] = "YusoChan-"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
CC_SetPrefix("&x01[&x04ADMIN&x01]");
}

public 
client_putinserver(id)

{
    
set_task(3.0,"administrator",id)
}

public 
administrator(id
{
    if(
get_user_flags(id) & ADMIN_SLAY)
    {
        new 
Szname[32]
        
get_user_name(idSzname31)
        
CC_SendMessage(0"%s &x01%s &x03Connected in the &x04Server!"Szname)
    }



CryWolf 10-22-2021 15:53

Re: Health, Armor, money
 
PHP Code:

public administrator(id
{
    new 
szName 33 ];
    
get_user_name idszNamecharsmax szName ) );

        if(
get_user_flags(id) & ADMIN_SLAY)
        {
            
CC_SendMessage(0"%s &x01%s &x03Connected in the &x04Server!"szName)
        }
        else if(
get_user_flags(id) & ADMIN_LEVEL_Z)
    {
        
CC_SendMessage(0"%s &x01%s &x03Connected in the &x04Server!"szName)
    }


You can also think to use , tought this needs that amxmisc.inc to be included (#include amxmisc)
PHP Code:

switch ( get_user_flags id ) )
    case 
1ADMIN_SLAY
    
{
        
message
    
}
    case 
2ADMIN_LEVEL_Z
    
{
        
message
    


And for when he leaves the server use
PHP Code:

public client_disconnected id )
{
    new 
szName [33];
    
get_user_name (idszNamecharsmax szName ) );

    
CC_SendMessage(0"%s &x01%s &x03Has Leaved the &x04Server!"szName)



Yusochan 10-22-2021 16:20

Re: Health, Armor, money
 
Quote:

Originally Posted by CryWolf (Post 2761367)
PHP Code:

public administrator(id
{
    new 
szName 33 ];
    
get_user_name idszNamecharsmax szName ) );

        if(
get_user_flags(id) & ADMIN_SLAY)
        {
            
CC_SendMessage(0"%s &x01%s &x03Connected in the &x04Server!"szName)
        }
        else if(
get_user_flags(id) & ADMIN_LEVEL_Z)
    {
        
CC_SendMessage(0"%s &x01%s &x03Connected in the &x04Server!"szName)
    }


You can also think to use , tought this needs that amxmisc.inc to be included (#include amxmisc)
PHP Code:

switch ( get_user_flags id ) )
    case 
1ADMIN_SLAY
    
{
        
message
    
}
    case 
2ADMIN_LEVEL_Z
    
{
        
message
    


And for when he leaves the server use
PHP Code:

public client_disconnected id )
{
    new 
szName [33];
    
get_user_name (idszNamecharsmax szName ) );

    
CC_SendMessage(0"%s &x01%s &x03Has Leaved the &x04Server!"szName)



Thank you for ur help !

Natsheh 10-23-2021 10:27

Re: Health, Armor, money
 
Leaved => left

Grammar committed death.

Yusochan 10-23-2021 14:26

Re: Health, Armor, money
 
Quote:

Originally Posted by Natsheh (Post 2761418)
Leaved => left

Grammar committed death.

Yeah, lmao


All times are GMT -4. The time now is 11:29.

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