SA-MP Forums Archive
error: inputtext must be assigned to an array - 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: error: inputtext must be assigned to an array (/showthread.php?tid=639803)



error: inputtext must be assigned to an array - ImTobi - 23.08.2017

https://pastebin.com/giC6YUGB

the error is in sInfo[playerid][rpname] = inputtext;


Re: error: inputtext must be assigned to an array - Misiur - 23.08.2017

You can't copy strings like that. Put this on top of your gamemode:
pawn Код:
#define strcpy(%0,%1) \
    strcat((%0[0] = '\0', %0), %1)
And change your line to
pawn Код:
strcpy(sInfo[playerid][rpname], inputtext, ? ?);
And replace ? ? with size of your rpname


Re: error: inputtext must be assigned to an array - ImTobi - 23.08.2017

Quote:
Originally Posted by Misiur
Посмотреть сообщение
You can't copy strings like that. Put this on top of your gamemode:
pawn Код:
#define strcpy(%0,%1) \
    strcat((%0[0] = '\0', %0), %1)
And change your line to
pawn Код:
strcpy(sInfo[playerid][rpname], inputtext, ? ?);
And replace ? ? with size of your rpname
Thanks it worked! Everything works now