AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP ON|OFF (https://forums.alliedmods.net/showthread.php?t=135127)

totalcsscripting 08-12-2010 22:49

HELP ON|OFF
 
I have this two functions,

PHP Code:

public plugin_init()
{
    
register_concmd("amx_ghost","admin_ghost"
    
register_concmd("amx_unghost","admin_unghost"
}

public 
admin_ghost(id,level,cid

    if (!
cmd_access(id,level,cid,1)) 
        return 
PLUGIN_HANDLED 
    
new params[3]
    
client_print(id,print_chat,"[TotalCS] Sos un fantasma!")
    
params[0] = id 
    IsGhost
[id] = 
    set_user_godmode
(id,1)
    
set_user_footsteps (id 1)
    
set_task(0.2"changecolor"BPID idparams2"b")
    return 
PLUGIN_HANDLED 


public 
admin_unghost(idlevelcid

    if (!
cmd_access(id,level,cid,1)) 
    return 
PLUGIN_HANDLED 
    IsGhost
[id] = 0
    client_print
(id,print_chat,"[TotalCS] Ya no sos un fantasma!")
    
set_user_godmode(id,0
    
set_user_footsteps (id 0)
    
set_user_rendering(id,kRenderFxNone,255,255,255kRenderNormal,16)
    
remove_task(BPID id
    return 
PLUGIN_HANDLED 


I want to replace this with a simple

amx_ghost <player> 1|0 for On|Off

fysiks 08-12-2010 23:16

Re: HELP ON|OFF
 
So, what's the question? Have you even tried to do it yet? Show your code.

Hint: Look at other admin commands for examples of how to do the <player> part.


All times are GMT -4. The time now is 21:58.

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