AlliedModders

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

lexzor 01-05-2021 20:11

get_user_name
 
Hello, i have a problem with this code

PHP Code:

public getPlayedTime(id)
{
    static 
arg[MAX_NAME_LENGTH]
    static 
name[MAX_NAME_LENGTH]
    
read_argv(1argsizeof(arg) - 1)
    static 
playerplayer cmd_target(idarg2)
    
get_user_name(playernamesizeof(name) -1)
    
    if(
player && read_argv(1argsizeof(arg) - 1) > 0){
        
get_user_authid(playerkey[player], 32)
        
get_time_length(id, (get_user_time(id) + nvault_get(vaultkey[player])), timeunit_seconds output63);
        
ColorChat(idGREEN"^x04[JoiNET]^x01 Player^4 %s^1 accumulated a total of ^x04 %s^x01 on our server!"name[player], output);
    } else if (!
player && read_argv(1argsizeof(arg) - 1) > )
    
ColorChat(idGREEN"^x04[JoiNET]^x01 Player does not exists!");
    else if ( 
read_argv(1argsizeof(arg) - 1) == 0  ){
        
get_time_length(id, (get_user_time(id) + nvault_get(vaultkey[id])), timeunit_seconds output63);
        
ColorChat(idGREEN"^x04[JoiNET]^x01 You have accumulated a total of ^x04 %s^x01 on our server!"output);
    }
    


it doesn't show me the whole name, just 1-2 letters. why ?

lexzor 01-05-2021 20:25

Re: get_user_name
 
ok is solved it the incorect part was this
PHP Code:

ColorChat(idGREEN"^x04[JoiNET]^x01 Player^4 %s^1 accumulated a total of ^x04 %s^x01 on our server!"name[player], output); 

->
PHP Code:

ColorChat(idGREEN"^x04[JoiNET]^x01 Player^4 %s^1 accumulated a total of ^x04 %s^x01 on our server!"nameoutput); 



All times are GMT -4. The time now is 14:12.

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