Raised This Month: $ Target: $400
 0% 

How to check if a player's name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 07-14-2012 , 14:45   How to check if a player's name
Reply With Quote #1

Well I have this code that reads what is written the .ini file now my question is how I can get to what is written is a player name.

PHP Code:
#include <amxmodx> 

new szVersion[] = "1.0"

public 
plugin_init() 

    
register_plugin("Read"szVersion"Asd'")
    
    
register_clcmd("say /result""Command_ReadFile")


public 
Command_ReadFile(id

    new 
szFileData[160]
    new 
szFilePath[60]
    new 
szFileConfig[60]
    
    
get_localinfo("amxx_configsdir"szFileConfig59)
    
formatex(szFilePath59"%s/Test.ini"szFileConfig)
    
    new 
iFile fopen(szFilePath"r")
    
    while(!
feof(iFile))
    { 
        
fgets(iFileszFileData459)

        
client_print(idprint_chat"Testing: %s"szFileData)
    } 
    
fclose(iFile)

Thank you very much hope to get help early.
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 07-14-2012 , 18:40   Re: How to check if a player's name
Reply With Quote #2

new szName[32]; get_user_name(id, szName, charsmax(szName))
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-14-2012 , 22:41   Re: How to check if a player's name
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
new szName[32]; get_user_name(id, szName, charsmax(szName))
Read it again please.

PLEASE.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-14-2012 , 22:56   Re: How to check if a player's name
Reply With Quote #4

What is the format of the ini file?
__________________
Bugsy is offline
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 07-14-2012 , 23:25   Re: How to check if a player's name
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
What is the format of the ini file?
String Ejm: "DJHD!"
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.

Last edited by DJHD!; 07-14-2012 at 23:40.
DJHD! is offline
Send a message via MSN to DJHD!
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-15-2012 , 00:15   Re: How to check if a player's name
Reply With Quote #6

This will parse "String Ejm" .. you could also do szFileData[ iPos ] = EOS then just use szFileData.
PHP Code:
new szName32 ] , iPos strfindszFileData ":" );
    
if ( 
iPos > -1  )
{
    
copyszName iPos <= charsmaxszName ) ? iPos charsmaxszName ) , szFileData );
    
client_print(idprint_chat"Testing: %s"szName )

__________________

Last edited by Bugsy; 07-15-2012 at 00:17.
Bugsy is offline
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 07-15-2012 , 06:27   Re: How to check if a player's name
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
This will parse "String Ejm" .. you could also do szFileData[ iPos ] = EOS then just use szFileData.
PHP Code:
new szName32 ] , iPos strfindszFileData ":" );
    
if ( 
iPos > -1  )
{
    
copyszName iPos <= charsmaxszName ) ? iPos charsmaxszName ) , szFileData );
    
client_print(idprint_chat"Testing: %s"szName )

oh thanks I will test
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
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 15:04.


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