This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function On_DoorUse(player, de) { | |
player.Message("Door Event Executed"); | |
if(isMember(player)) { | |
if(getSquad(player) == getSquad(de.Entity.Owner)) { | |
player.Message("Door belongs to squad"); | |
de.Open = true; | |
} | |
} | |
player.Message("Door Event Ended"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PlayerInventory.prototype.AddItem = function(item, qty) { | |
var self = this; | |
console.log(item) | |
var action = function(item, qty) { | |
var exists = _.findLessThan(self.Items,{Name:item},'UsesLeft',itemDB[item].stack); | |
if(exists && exists.UsesLeft < itemDB[item].stack && itemDB[item].stack!=1) { | |
exists.UsesLeft+=1; | |
if(qty-1>0) { | |
qty--; | |
action(item, qty); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUGIN.Title = "PlayersWebService" | |
PLUGIN.Description = "Publishes player list to a website" | |
local alternate = true | |
function PLUGIN:Init() | |
oxmin_mod = cs.findplugin("oxmin") | |
oxmin_mod:AddExternalOxminChatCommand(self, "online", {}, cmdList) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an empty array and hydrate it | |
var items = []; | |
data.map(function (item) { | |
if (item.kind === 'track') { | |
items.push({ | |
id: item.id, | |
title: item.title, | |
provider: self.provider, | |
artist: item.user.username, | |
artwork: item.artwork_url, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src='//code.jquery.com/jquery-1.10.2.min.js'></script> | |
<script src='//cdn.jsdelivr.net/jquery.cookie/1.3.1/jquery.cookie.js'></script> | |
<!-- .--- change to your roger server --> | |
<script src='http://localhost:4000/socket.io/socket.io.js'></script> | |
<script> | |
var socket; | |
$(function() { // .--- change to your roger server | |
socket = io.connect('http://localhost:4000'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(self, options) { | |
this.bind = function(events) { | |
for(var e in events) { | |
(function(func) { | |
options.socket.on(func, function(data) { self[func](options, data) }); | |
})(events[e]) | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quotes = { | |
sourceA:{ | |
AAPL:{bid:1, ask:1, last:3}, | |
BAC: {bid:1, ask:1, last:3}, | |
}, | |
sourceB:{ | |
AAPL:{bid:1, ask:1, last:3}, | |
BAC: {bid:1, ask:1, last:3}, | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('trendingStocks', function($http) { | |
return { | |
fetch:function() { | |
var promise = $http.jsonp('https://api.stocktwits.com/api/2/streams/trending.json?callback=JSON_CALLBACK').then(function (response) { | |
var exp = /(\$[A-Z]{1,5})/; | |
var tweets = response.data.messages; | |
var trending = []; | |
for(var t in tweets) { | |
var symbols = exp.exec(tweets[t].body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sounds = { | |
'singleshot': '/assets/sounds/singleshot.mp3' | |
} | |
for(var s in sounds) { | |
var path = sounds[s]; | |
sounds[s] = { | |
path:path, | |
clones:[], | |
channel:0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IE won't recognize events bound to multi-select options (or any <option> tag for that matter) | |
// This is how I worked around that issue (for multi select , I'm afraid it fails on standard select menus.) | |
$("#radicalMultiSelectMenu option").live("click-option",function() { | |
// code I would have put in live("click") if IE wasn't a bastard. | |
// instead, I just created a custom event called click-option. | |
console.log(this); | |
}); |
NewerOlder