strmid problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: strmid problem (
/showthread.php?tid=190984)
strmid problem -
Mystique - 17.11.2010
Allright so I'm trying to get the string from a file into the variable but it gives me this error:
Код:
error 035: argument type mismatch (argument 1)
And here's the line
Код:
strmid(PlayerInfo[playerid][Rankname] = (dUser(pName(playerid)).("Rankname"),0,128,128));
Re: strmid problem -
Mystique - 18.11.2010
Anyone who can help me?
Re: strmid problem -
JaTochNietDan - 18.11.2010
You can't assign a value to a variable within a function like that. Also that's not really what strmid is meant for, assigning a string to a variable is simple, this is what you may be looking for:
pawn Код:
PlayerInfo[playerid][Rankname] = dUser(pName(playerid)).("Rankname");
That will assign the return value of the dUser function to the variable PlayerInfo[playerid][Rankname].
Re: strmid problem -
Mystique - 18.11.2010
Код:
error 047: array sizes do not match, or destination array is too small
Re: strmid problem -
JaTochNietDan - 18.11.2010
Try increasing the size of the Rankname array.
Otherwise use format like so:
pawn Код:
format(PlayerInfo[playerid][Rankname],sizeof(PlayerInfo[playerid][Rankname]),"%s",dUser(pName(playerid)).("Rankname"));
Re: strmid problem -
Mystique - 18.11.2010
I increased it but it didn't work.
The second one gave me these errors.
Код:
error 001: expected token: "]", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Re: strmid problem -
Mystique - 18.11.2010
Thanks ******, the error is gone.