Quote:
Originally Posted by dowster
when you use this one
pawn Code:
stock asd(string[],&string1[],&string2[])
are you having a return 1; at the end?
|
Yes I did. It give error on that line.
Quote:
Originally Posted by RealCop228
What is with the & sign before the string names?
Couldn't you just do "string1[]," string[2]?"
|
https://sampwiki.blast.hk/wiki/Stocks#Re...ultiple_values
Quote:
Originally Posted by cessil
not really returning 2 string however you can pass strings through stocks and have them change, here's a quick example
pawn Code:
stock StockPasses2String(&string1[],len1,&string2[],len2) { new TempStringOrSomthing[32] = "I equal nothing important"; for(new i=0;i<len1;i++) { string1[i] = TempStringOrSomthing[i]; } TempStringOrSomthing = "I Have Changed To Something Else"; for(new i=0;i<len2;i++) { string2[i] = TempStringOrSomthing[i]; } }
|
Quote:
Originally Posted by Blacklite
You can't "return" 2 strings. The only way to achieve anything like this is with cessil's example.
|
variable cannot be both a reference and an array (variable "string1")