So i have this code
//REFERRALS CMDS
[login to view URL]('referrals use code', function(code, csrf) {
var address = [login to view URL]['x-forwarded-for'] || [login to view URL];
if(coolDown[address]+1 >= time()) {
[login to view URL]('message', {
type: 'msg',
tip: 'error',
msg: 'We are already processing one of your requests, please be patient.'
});
return;
} else {
coolDown[address] = time()+1;
}
if(csrf && code)
{
if(!steamIDCsrf[csrf]['code_used'])
{
[login to view URL]('SELECT steamid FROM users WHERE codeCreated = ' + [login to view URL](code), function(e, r) {
if(e) throw e;
if([login to view URL] == 0)
{
[login to view URL]('message', {
type: 'msg',
tip: 'error',
msg: 'This code does not exist.'
});
}
else
{
if(r[0].steamid == steamIDCsrf[csrf]['steamid'])
{
[login to view URL]('message', {
type: 'msg',
tip: 'error',
msg: 'You cannot redeem your own code.'
});
return;
}
if((/^([a-zA-Z0-9]{1,12})$/.test(code)) == true)
{
[login to view URL]('UPDATE users SET balance = balance + 100, codeUsed = ' + [login to view URL](code) + ', referral = ' + [login to view URL](r[0].steamid) + ' WHERE steamid = ' + [login to view URL](steamIDCsrf[csrf]['steamid']), function(ccc, bbb) {
[login to view URL]('UPDATE users SET ref_balance = ref_balance + 15 WHERE steamid = ' + [login to view URL](r[0].steamid), function(jk, kj) {
newBalance(csrf);
steamIDCsrf[csrf]['code_used'] = code;
[login to view URL]('message', {
type: 'msg',
tip: 'alert',
msg: 'You successfully redeem code ' + code + '.'
});
});
});
}
else
{
[login to view URL]('message', {
type: 'msg',
tip: 'error',
msg: 'Invalid characters or the code have more than 12 characters.'
});
return;
}
}
});
}
}
});
And i want to add function to verify if steam profile have game pubg
i have someting for this but no work i want to integrate this
var out;
out = curl("[login to view URL]" + user["steamid"] + "&format=json");
out = json_decode(out, true);
if (!out["response"]) {
throw new Exit(json_encode({
"success": false,
"error": "You profile is private"
}));;
}
var csgo;
csgo = false;
var key;
__loop1:
for (key in out["response"]["games"]) {
var value;
value = out["response"]["games"][key];
if (value["appid"] == 578080) {
csgo = true;
}
}
if (!csgo) {
throw new Exit(json_encode({
"success": false,
"error": "You dont have PUBG."
}));;
}
to first code
Check our many good reviews from our satisfied customers in software and websites development. We will make you happy
Relevant Skills and Experience
developer
Stay tuned, I'm still working on this proposal.
Hi
If you hire me, i will complete your project perfectly.
I am interested in your project.
I want to have a talk with you about your project in detail.
Relevant Skills and Experience
Java, Javascript, PHP, Steam API
Proposed Milestones
$55 USD - 1