small problem - affecting string 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: small problem - affecting string to an array (
/showthread.php?tid=565148)
small problem - affecting string to an array -
Alvin007 - 25.02.2015
Hello all i have a small problem.
PHP код:
if(PlayerInfo[playerid][pFaction]==0) PlayerInfo[playerid][pRank]="none";
the code above won't work.
Error message.
Quote:
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 500) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
|
Re: small problem - affecting string to an array -
KtotheYle - 25.02.2015
Make sure that pRank is labeled as a string, like pRank [128] in the enum.
Re : small problem - affecting string to an array -
Alvin007 - 25.02.2015
Yes it is.
Re: small problem - affecting string to an array -
CalvinC - 25.02.2015
You have to format it.
pawn Код:
if(PlayerInfo[playerid][pFaction]==0) format(PlayerInfo[playerid][pRank], 30, "none");
Re : small problem - affecting string to an array -
Alvin007 - 25.02.2015
Thanks for your support, it works.