Knut the Bruin
Joined: 19 Jul 2008 Posts: 2
|
Posted: Sat Jul 19, 2008 12:19 pm Post subject: Usefull Update for the Player Position Notes Script |
|
|
if you use that script and you dont have the playerid in your notes-array it will replace the position anyways with "undefined"
so - mainly on the player pages of other players - you will see "undefined <playername>" instead of "(OT) <playername>" - imho not usefull on player pages from players you dont own...
so i made the following changes to the source code:
replace
| Code: | | playername[i].innerHTML = playername[i].innerHTML.replace(matches[0].replace(re, "$3"), notes[playerId]); |
with
| Code: | if(typeof(notes[playerId]) != "undefined"){
playername[i].innerHTML = playername[i].innerHTML.replace(matches[0].replace(re, "$3"), notes[playerId]);
} |
and replace
| Code: | | player_name.innerHTML = player_name.innerHTML.replace(matches[0].replace(re, "$1"), notes[currentId]); |
with
| Code: | if(typeof(notes[currentId]) != "undefined"){
player_name.innerHTML = player_name.innerHTML.replace(matches[0].replace(re, "$1"), notes[currentId]);
} |
now the original glb position tag is only replaced if the script has found a valid custom tag for that player number.
i dont know if you find it usefull but ill enjoy any kind of reply
greets
Knut
|
|