help cmd id
#2

This would be fairly easy with sscanf and y_commands or ZCMD.

PHP Code:
CMD:id(playeridparams[])
{
    
// Creating the variables we will need
    
new String[128], TargetTargetName[MAX_PLAYER_NAME];
    
    
// Checking that all the params are there, and that everything is in order
    
if(sscanf(params"u"Target)) SendClientMessage(playeridCOLOR_INFO"* Usage: /id [playerid/PartOfName]");
    else    
// If everything is in order, this will happen
    
{
        
// Checking that the player is online and that the ID is valid
        
if(Target != INVALID_PLAYER_ID)        
        {
            
// Getting player name into the formerly created string
            
GetPlayerName(TargetTargetNamesizeof(TargetName));    
            
            
// Formatting it to how you wanted it. Player_Name [ID:10]
            
format(Stringsizeof(String), "%s [ID:%d]"TargetNameTarget);    
            
            
// Sending the message
            
SendClientMessage(playeridCOLOR_INFOString);                    
        }
    }
    return 
1;                                                                

EDIT: The command for getting phone number is fairly similar. Just edit the name of the command and edit the format variables to how you want them.

PHP Code:
format(Stringsizeof(String), "%d - %s [ID:%d]"PhoneNumberVariableTargetNameTarget);
// Will output 1337 - Player_Name [ID:10] 
Reply


Messages In This Thread
help cmd id - by tooMuch - 08.02.2015, 19:37
Re: help cmd id - by Knappen - 08.02.2015, 20:47
Re: help cmd id - by Sime30 - 08.02.2015, 20:48
Re: help cmd id - by tooMuch - 09.02.2015, 10:37
Re: help cmd id - by De4dpOol - 09.02.2015, 11:12
AW: help cmd id - by Nero_3D - 09.02.2015, 11:12
Re: help cmd id - by tooMuch - 09.02.2015, 11:22
Re: help cmd id - by De4dpOol - 09.02.2015, 11:30
Re: help cmd id - by tooMuch - 09.02.2015, 11:49
Re: help cmd id - by De4dpOol - 09.02.2015, 11:57

Forum Jump:


Users browsing this thread: 3 Guest(s)