Easycore 31 Posted November 22, 2016 Hello, It's posible use getd in SRC? For eg: M$ = Var getd(""+M$+"Something") = "VarSomething". I tried: pc_readglobalreg(sd,script->add_str("M$"))+"Something" , but it generates map-server-crash. In short, I would like to be able to "join" strings. For more information, I used this in clif->soundeffectall: clif->soundeffectall(src, (pc_readglobalreg(sd,script->add_str("M$"))+".wav"),0, AREA); Regards~ Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted November 23, 2016 1) you cannot concat string directly, that should have given some sort of compile warning. 2) use pc_readglobalreg_str Quote Share this post Link to post Share on other sites
0 Easycore 31 Posted November 23, 2016 1) you cannot concat string directly, that should have given some sort of compile warning. 2) use pc_readglobalreg_str I was researching about that... And finally I came to a solution: { char* a = pc_readglobalreg_str(sd,script->add_str("M$")); char* b = ".wav"; char* c = (char* ) malloc(1 +sizeof(char*) * (strlen(a)+ strlen()); strcpy(c, a); strcat(c, ; clif->soundeffectall(src, c,0, AREA); } So, I get compile warnings for 'strcpy' and 'strcat': warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. Quote Share this post Link to post Share on other sites
Hello,
It's posible use getd in SRC?
For eg:
M$ = Var
I tried:
pc_readglobalreg(sd,script->add_str("M$"))+"Something" , but it generates map-server-crash.
In short, I would like to be able to "join" strings.
For more information, I used this in clif->soundeffectall:
Regards~
Share this post
Link to post
Share on other sites