Strings into array..
#1

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
Reply
#2

https://sampwiki.blast.hk/wiki/SetPVarString
https://sampwiki.blast.hk/wiki/GetPVarString
Reply
#3

Thats not what i need!!
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)