I will show here few examples.
First Example:
1
2
3
4
2
3
4
addhook("team", "onTeam") function onTeam(id) 	parse('hudtxt2 '.. id ..' 1 "'.. player(id, "name") ..'" 0 0 0'); end
1
hudtxt2 1 1 "NAME" 0 0 0
Now let's try to something better as name:
1
" 0 0 0; exit;
Now it will look like this:
1
hudtxt2 1 1 "" 0 0 0; exit;" 0 0 0
After player joining team, server will shutdown, because it executed command exit
http://screenshooter.net/8536295/sjkkyxs
You should filter the name first.
Second Example:
Saving player data as lua script. I tested it on weiwen's script. Even when he has used string.format I could fuck up players database.
This is how saved database looks like:
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
-- PLAYERCACHE -- PLAYERCACHE[9102] = {Inventory={}, Tutorial={}, MP=100, Money=300, name="mafia_man", y=51, Equipment={}, x=60, Experience=0, tmp={usgn=9102, atk=1, def=1, equip={{}, {}, {}, {}, {}, {}, {}, {}, {}}, exhaust={talk=true}, hp=100, spd=0}, Info={}, Level=1, HP=200, Spawn={1936, 1648}} -- GLOBAL STORAGES -- GLOBAL["TIME"] = 285 GLOBAL["RAIN"] = 0
I tried "--[[ as name and what happened?
1
PLAYERCACHE[9102] = {Inventory={}, Tutorial={}, MP=100, Money=300, name='"--[['
Let's try both '" now - '"--[[
1
PLAYERCACHE[9102] = {Inventory={}, Tutorial={}, MP=100, Money=300, name="'\"--[["
Now let's try this using escape character: \''\""--
1
PLAYERCACHE[9102] = {Inventory={}, Tutorial={}, MP=100, Money=300, y=51, x=60, name="\''\\"\"--",
This one \ character will fuck up whole database.
I tested both of these examples and they work. Please fix your lua scripts!