ID:264678
 
Code:
        var/Cash = copytext(file2text(http["CONTENT"]),1,5)
src.CashPoints+=Cash


Problem description: I have 2 problems with this:

1st_When i add the + it sends me this:
runtime error: type mismatch: 0 += "10"
proc name: AddCash (/mob/proc/AddCash)
usr: Prestige Entertainment (/mob)
src: Prestige Entertainment (/mob)
call stack:
Prestige Entertainment (/mob): AddCash()
Prestige Entertainment (/mob): Refresh Purchases(Prestige Entertainment (/mob))

2nd Error_ if i remove the + when i add 10.000 cash it only adds 1.000 o.O


"1" is a string.
1 is a number.

1+1=2
1+"pie"=?

Look up the text2num function in the reference.
In response to Keeth
But i never used " " in this code o.O
In response to Prestige Entertainment
copytext() gives you a text string, which is not a number.

The number 1 is very different from a text string consisting of the number 1. Hence, the quotes around it to differentiate the two.
In response to Prestige Entertainment
Nope, but you certainly are using a text string there, aren't you?
In response to Keeth
No, im using numbers. Its Mysql the Type is *Edit Text
In response to Prestige Entertainment
It wasn't a question. You are using copytext, which copies a portion of text from another piece of text. Cash contains a text string.
In response to Keeth
Yes. but check this.

Click Here
In response to Prestige Entertainment
Yes. That is a string of characters. Those characters are all the character 9, and therefore they look like a number, but they are still the string of characters "999999".
In response to Garthor
oh. noob me =o. Then there's anyway to make it a number?
In response to Prestige Entertainment