Copying strings (strcpy) - GAHHHHH - 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)
+--- Thread: Copying strings (strcpy) - GAHHHHH (
/showthread.php?tid=314760)
Copying strings (strcpy) - GAHHHHH -
MP2 - 31.01.2012
I've made a couple of topics about this before, but here's another one.
I have an enum array of strings, like so
enum enumlol
{
string[64]
}
new array[MAX_PLAYERS][MAX_DIALOGS][enumlol];
and I'm trying to copy the string from
array[0][1][0]
in to
array[0][0][0]
but it's not working properly. I haven't done much debugging, but from what I can tell it's just setting the string to ""
Are there any alternatives to strcpy?
EDIT:
pawn Код:
enum testvars
{
teststring[64]
}
new test[testvars];
new hsdfghlsdgh[128];
strcpy(test[teststring], "Hello World!");
format(hsdfghlsdgh, 128, "%s", test[teststring]);
SendClientMessage(playerid, -1, hsdfghlsdgh);
It outputs a blank clientmessage...
Re: Copying strings (strcpy) - GAHHHHH - T0pAz - 31.01.2012
pawn Код:
format(array[0][0][0], sizegoeshere, "%s", array[0][1][0]);
Can you please explain in details?
Re: Copying strings (strcpy) - GAHHHHH -
MP2 - 31.01.2012
Thanks for clearing that up ******, can't tell you how much of a weight that is off my shoulders!