SA-MP Forums Archive
[Solved]Need help with this string. - 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: [Solved]Need help with this string. (/showthread.php?tid=122981)



[Solved]Need help with this string. - Celson - 24.01.2010

I just wanna set a variable to a string set in a user file. I'm using dubd.

Код:
new name1[MAX_PLAYER_NAME] = dUser("Server").("topkills1name");
The error I get is..

error 008: must be a constant expression; assumed zero


Re: [Unsolved]Need help with this string. - Celson - 24.01.2010

Surely someone can tell me what's wrong with this?


Re: [Unsolved]Need help with this string. - Mr L - 24.01.2010

maybe you should delete the . and put &


Re: [Unsolved]Need help with this string. - Calgon - 24.01.2010

You're only allowed to bump after 12 hours, not 1 hour.

You're trying to get the variable and use a full stop.

Use dUserSet(). The syntax is:
dUserSet(nickname[],key[],value[])


Re: [Unsolved]Need help with this string. - [HiC]TheKiller - 24.01.2010

Use dUser("Server").("topkills1name"); directly.


Re: [Unsolved]Need help with this string. - Celson - 24.01.2010

Quote:
Originally Posted by CalgonX
You're only allowed to bump after 12 hours, not 1 hour.

You're trying to get the variable and use a full stop.

Use dUserSet(). The syntax is:
dUserSet(nickname[],key[],value[])
Ehh, are you sure? Wouldn't that be setting the string in the file?



Quote:
Originally Posted by [HiC
TheKiller ]
Use dUser("Server").("topkills1name"); directly.
If I do, then it uses up 256 cells. Which is a waste since the max a name can be is 24 cells right?



Re: [Unsolved]Need help with this string. - Mr L - 24.01.2010

just do what he sayed..


Re: [Unsolved]Need help with this string. - dice7 - 24.01.2010

pawn Код:
new name1[MAX_PLAYER_NAME];
Strcat(name, dUser("Server").("topkills1name"), MAX_PLAYER_NAME);



Re: [Unsolved]Need help with this string. - Celson - 24.01.2010

Quote:
Originally Posted by dice7
pawn Код:
new name1[MAX_PLAYER_NAME];
Strcat(name, dUser("Server").("topkills1name"), MAX_PLAYER_NAME);
Thank you very much


Re: [Unsolved]Need help with this string. - Celson - 24.01.2010

EDIT: Nevermind, solved.