Raised This Month: $51 Target: $400
 12% 

Replacing %s on file with player name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 06:23   Replacing %s on file with player name
Reply With Quote #1

Hi every1
I have an problem I hope you will help me with it


Code:
show_hudmessage(id, "%s" ,szText,player) //(%s reads the file so dont mess with it :D)//
What I need is to replace %s (ON FILE) with name of player in game

Thanx,sorry for short code...

Last edited by thEsp; 07-02-2018 at 07:00.
thEsp is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 07-02-2018 , 06:43   Re: Replacing %s on file with player name
Reply With Quote #2

WTF is this ?
PHP Code:
show_hudmessage(id"%s" szText,player// Where is ( , ) bro ? 
Just use fgets and get data from the file and assign szText to the data and then use it here
instinctpt1 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 06:57   Re: Replacing %s on file with player name
Reply With Quote #3

I edited post so I acidentally removed it . LOL
(sry)
thEsp is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-02-2018 , 07:12   Re: Replacing %s on file with player name
Reply With Quote #4

You are passing 2 variables for formating but only one %s
__________________
stuff
maqi is offline
Old 07-02-2018, 07:40
thEsp
This message has been deleted by thEsp.
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-02-2018 , 07:42   Re: Replacing %s on file with player name
Reply With Quote #5

And i just told you why
__________________
stuff
maqi is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-02-2018 , 07:54   Re: Replacing %s on file with player name
Reply With Quote #6

Quote:
Originally Posted by maqi View Post
You are passing 2 variables for formating but only one %s

But if szText also contains %s then it will work (or not?)
anyway what are types of those variables ? szText, player.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 07-02-2018 at 07:58.
Ghosted is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-02-2018 , 07:59   Re: Replacing %s on file with player name
Reply With Quote #7

Are we supposed to read minds ?

He showed us one line of code without any context
__________________
stuff
maqi is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 07-02-2018 , 08:01   Re: Replacing %s on file with player name
Reply With Quote #8

Quote:
Originally Posted by thEsp View Post
Doesnt work at all bro
Show us full code
Or just show this function and the file you are trying to read
instinctpt1 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 08:12   Re: Replacing %s on file with player name
Reply With Quote #9

Quote:
Originally Posted by instinctpt1 View Post
Show us full code
Or just show this function and the file you are trying to read
szText is file text and player gets name of player

I fixed this but I just need to get lens of text file,would you help me on that
thEsp is offline
thEsp
BANNED
Join Date: Aug 2017
Old 07-02-2018 , 08:12   Re: Replacing %s on file with player name
Reply With Quote #10

Quote:
Originally Posted by maqi View Post
Are we supposed to read minds ?

He showed us one line of code without any context
new szText[64], len
format(szText, 63, dir)
read_file(dir,0,szText,63,len)

new player[32]
get_user_name(id,player,32)

Last edited by thEsp; 02-23-2019 at 16:11.
thEsp is offline
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 06:46.


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