SA-MP Forums Archive
Strings into 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Strings into array.. (/showthread.php?tid=161585)



Strings into array.. - deather - 20.07.2010

I have a set of strings from the player.
Код:
/set "Name" "Sex" "Location"
I have an array.
Код:
new parray[MAX_PLAYERS][3];
How do i add the strings in to the array such that i can retrive it later...
I tried
Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    strpack(parray[i][0], entered[item][name]);
    strpack(parray[i][1], entered[item][sex]);
    strpack(parray[i][2], entered[item][loc]);
}
I tried with format() too

But i get these errors
Код:
error 029: invalid expression, assumed zero
error 008: must be a constant expression; assumed zero



Re: Strings into array.. - klavins21 - 20.07.2010

https://sampwiki.blast.hk/wiki/SetPVarString
https://sampwiki.blast.hk/wiki/GetPVarString


Re: Strings into array.. - deather - 20.07.2010

Thats not what i need!!


Re: Strings into array.. - RyDeR` - 20.07.2010

You have 3 options or maybe more but here are they:
- strmid
- format
- SetPVarString


Re: Strings into array.. - MadeMan - 20.07.2010

pawn Код:
new parray[MAX_PLAYERS][3][32];
Then use format.