Using string.explode in my derma menu.

If my PData is something like:



ak47 m16 mp5 awp scout


Then how could i explode this string into single values and display them in a DListView

for example
[lua]
string.Explode(" ",ply:GetPData(“weapons”))
[/lua]

How could i make this display in a table i think using the for/looping thing.

You can’t save things on the server and call them on the client.

Network them with usermessages.

Why cant i save them?

The clients derma will run a console command and remove their cash and purchase the weapon and add it to their equip page. Then the client can go to the equip page in their derma and it will list all the weapons they have brought.

How can i make it call each weapon from the PData and seperately put it into the DListView.

Did you read my post? You’re trying to call this stuff on the client, you can’t do that if it’s saved on the server. All the buying should be handled on the server and then networked back to the client.

I’m not very good with networking could you please give me an example.

Do you mean umsgs (usermessages). I do not have a clue how to do them.

And also, what is the best way of saving stuff which is brought through the derma then verify and process on server, route it back to the clients derma to show all things brought then add the selected ones to the players loadout.

There’s this thing called the wiki, and it has this search bar, go type usermessage into it.

Use console commands to send data to the server and usermessages to send back.

Thank you for that, I will read up on this more tomorrow.