strmid problem
#1

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));
Reply
#2

Anyone who can help me?
Reply
#3

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].
Reply
#4

Код:
error 047: array sizes do not match, or destination array is too small
Reply
#5

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"));
Reply
#6

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
Reply
#7

Thanks ******, the error is gone.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)