Raised This Month: $ Target: $400
 0% 

Replacing problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SlimDog
Junior Member
Join Date: Mar 2006
Location: Lithuania
Old 03-27-2006 , 15:00   Replacing problem
Reply With Quote #1

Let's say i have

Code:
get_user_name(krcid,veikejas,32)

So veikejas = players name.

Now I'm geeting a line from .ini file wich may have <nick> text in it. I want that text <nick> would be replaced with veikejas.

I tried
Code:
replace(message, 130, "<nick>", veikejas)

But it still won't replace anything... I thought it could be bad that "<nick>" is in commas so i deleted them and leaved

Code:
replace(message, 130, <nick>, veikejas)

But then i get compile errors...

If someone could help... HELP!
__________________
SlimDog is offline
BadAim
Senior Member
Join Date: Feb 2006
Location: canada
Old 03-27-2006 , 16:12  
Reply With Quote #2

man if you want to chnage the name of your players just use
AMX_NICK "the current name" "the name u want"
BadAim is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-27-2006 , 16:58  
Reply With Quote #3

Umm, not quite sure what your question is. You format strings like this:

Code:
new szName[33] get_user_name(id,szName,32) replace(szMyStr,127,"<name>",szName)

Also, you cannot pass direct data to act like a string. The compiler has no way of knowing whether you expect a variable / command or a string. So this would work:

Code:
 replace(message, 130, "<nick>", veikejas)

But this would not:
Code:
 replace(message, 130, <nick>, veikejas)

As per your question though, are you sure the inputted section has brackets ( < and > ) around it?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
BadAim
Senior Member
Join Date: Feb 2006
Location: canada
Old 03-27-2006 , 17:22  
Reply With Quote #4

lol listen to him hes a beta tester and im a noob
BadAim is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-27-2006 , 17:35  
Reply With Quote #5

Quote:
Originally Posted by CoKsUcKer
lol listen to him hes a beta tester and im a noob
Just because someone is a beta tester doesn't mean that they know a lot about scripting. However Hawk does know about scripting.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SlimDog
Junior Member
Join Date: Mar 2006
Location: Lithuania
Old 03-27-2006 , 23:39  
Reply With Quote #6

Quote:
Originally Posted by Hawk552
Umm, not quite sure what your question is. You format strings like this:

Code:
new szName[33] get_user_name(id,szName,32) replace(szMyStr,127,"<name>",szName)

Also, you cannot pass direct data to act like a string. The compiler has no way of knowing whether you expect a variable / command or a string. So this would work:

Code:
 replace(message, 130, "<nick>", veikejas)

But this would not:
Code:
 replace(message, 130, <nick>, veikejas)

As per your question though, are you sure the inputted section has brackets ( < and > ) around it?
Yes I'm sure.. Thanks for help... I'll try replace <nick> with constant setted with that nick or remove < > from replacement.
__________________
SlimDog 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 16:29.


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