mob/verb/Test2()
var/pre=copytext(usr.name,1,1/2)
world<<"[pre]"
thats ma code but it still show the entire name y?
ID:266507
Mar 25 2002, 5:39 pm (Edited on Mar 25 2002, 5:47 pm)
|
|
In response to ACWraith
|
|
Fo u know how i would split the name in half
|
In response to Strange Kidd
|
|
proc/ShowHalves(message = "SuperDuperMonkeyFluper") |
In response to Foomer
|
|
proc/ShowHalves(message = "SuperDuperMonkeyFluper")
var/first_half = copytext(message,1,length(message)/2) var/second_half = copytext(message,length(message)/2,length(message)) usr << first_half usr << second_half</DM>That should do it. it said it was a undifined arg type |
In response to Strange Kidd
|
|
Then declare it like a normal var instead.
|
copytext("cat",1,0) will return "cat"
copytext("cat",1,3) will return "ca"
copytext("cat",1,2) will return "c"
You entered 1/2. I am guessing this will be read as 0. It is looking for an integer.
[edit]
After realizing the second argument was missing, ACWraith tripped and fell into a pit of spikes while attempting to avoid former Next Generation victims.