Huy,
Hope this answer is not too late.
The modulation object in the program uses modem.pskmod (see line 15 in program). You need to change it modem.qammod, if you want to carry out M-QAM simulation with this program.
There is a minor flaw in the section of Gold code generation which is causing the cross correlation between sequences (matrix B) to be output incorrectly. Replace
PN2(31) = PN2(1);
for k=1:G-1
PN2(k)=PN2(k+1)
end
with the following
temp = PN2(1);
PN2(1:G-1)=PN2(2:G);
PN2(G) = temp;