| Autor | Mesaj |
---|
Rank: Administrator Sex : Data de inscriere : 10/12/2011 | Subiect: PLUGIN REDIRECT AVANSAT Vin Feb 10, 2012 12:40 pm |
|
| - Cod:
-
#include <amxmodx> #include <amxmisc>
#define PLUGIN "BRETONIA REDIRECT SYSTEM" #define AUTHOR "OptimuS" #define VERSION "1.0"
new g_cvarMaxPlayers; new g_cvarTipRedirect;
static tipredirect; static randomint; static precompute;
new const servere[][] = { "127.0.0.1", "127.0.0.2", "127.0.0.3" }
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); g_cvarMaxPlayers = register_cvar("amx_rd_maxplayers", "0"); // Tipul de redirect // ------------------- // Valoarea 0 - disable // Valoarea 1 - Redirect tuturor inafara de cei care sunt slot + // Valoarea 2 - Redirect tuturor inafara de cei care sunt slot + si steameri // Valoarea 3 - Redirect tuturor (inclusiv admini) inafara de steameri // Valoarea 4 - Redirect tuturor, indiferent daca sunt steameri sau admini g_cvarTipRedirect = register_cvar("amx_rd_redirect_type", "1"); tipredirect = get_pcvar_num(g_cvarTipRedirect); // Salvam marimea const servere pentru optimizare consum de resurse precompute = sizeof (servere); }
public client_authorized(id) { if(!(get_pcvar_num(g_cvarTipRedirect))) return PLUGIN_CONTINUE switch(tipredirect) { case(1): { if( (get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) && !is_user_admin(id) ) { randomint = random_num(0, precompute); client_cmd(id, "Connect %s", servere[randomint]); } } case(2): { if( (get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) && !is_steam_user(id) ) { randomint = random_num(0, precompute); client_cmd(id, "Connect %s", servere[randomint]); } } case(3): { if( (get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) && !is_user_admin(id) && !is_steam_user(id) ) { randomint = random_num(0, precompute); client_cmd(id, "Connect %s", servere[randomint]); } } case(4): { if(get_playersnum() >= get_pcvar_num(g_cvarMaxPlayers)) { randomint = random_num(0, precompute); client_cmd(id, "Connect %s", servere[randomint]); } } } return PLUGIN_CONTINUE }
stock bool:is_steam_user(index) { new authid[8]; get_user_authid(index, authid, sizeof authid - 1); if(authid[7] == ':') return true; return false; } setarile amx_rd_maxplayers trebuie sa reprezinte de la cati playeri in sus inclusiv trebuie sa redirectioneze amx_rd_redirect_type // Tipul de redirect // ------------------- // Valoarea 0 - disable // Valoarea 1 - Redirect tuturor inafara de cei care sunt slot + // Valoarea 2 - Redirect tuturor inafara de cei care sunt slot + si steameri // Valoarea 3 - Redirect tuturor (inclusiv admini) inafara de steameri // Valoarea 4 - Redirect tuturor, indiferent daca sunt steameri sau admini aceste doua setari se trec de regula in amxx.cfg |
| | |
Rank: Utilizator MaXGaMe Data de inscriere : 25/06/2013 | Subiect: Re: PLUGIN REDIRECT AVANSAT Mar Iun 25, 2013 2:37 am |
|
| |
| | | |
Subiecte similare | |
|
Pagina 1 din 1 | |
| Permisiunile acestui forum: | Nu puteti raspunde la subiectele acestui forum
| |
| | ');
iframeDoc.close();
pbjs.renderAd(iframeDoc, winningBid.adId);
} else {
let fallback_html = '' + adUnit.custom_fallback.replaceAll("scr' + 'ipt", "script");
iframe.contentDocument.open();
iframe.contentDocument.write(fallback_html);
iframe.contentDocument.close();
}
}
const sendAdserverRequest = () => {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
adUnits.forEach(function(adUnit) {
renderWinningBidOrFallback(adUnit);
});
};
const requestBids = () => {
pbjs.adserverRequestSent = false;
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
});
};
pbjs.que.push(() => {
pbjs.setConfig({
"userSync": {
"syncEnabled": true,
"userIds": [
{
"name": "criteo"
}
],
"syncsPerBidder": 3,
"syncDelay": 3000,
"topics": {
"maxTopics": 5,
"vendors": [
"criteo"
]
}
},
"consentManagement": {
"gdpr": {
"cmpApi": "iab",
"timeout": 500,
"actionTimeout": 10000,
"defaultGdprScope": true,
"allowAuctionWithoutConsent": true
},
"usp": {
"cmpApi": "iab",
"timeout": 1000,
"allowAuctionWithoutConsent": true
}
},
"priceGranularity": {
"buckets": [
{
"precision": 2,
"min": 0,
"max": 5,
"increment": 0.01
},
{
"precision": 2,
"min": null,
"max": 8,
"increment": 0.02
},
{
"precision": 2,
"min": null,
"max": 15,
"increment": 0.05
},
{
"precision": 2,
"min": null,
"max": 20,
"increment": 0.1
},
{
"precision": 2,
"min": null,
"max": 50,
"increment": 0.5
}
]
},
"bidderSettings": {
"criteo": {
"storageAllowed": true
}
},
"paapi": {
"enabled": true,
"bidders": [
"criteo"
],
"defaultForSlots": 1,
"gpt": {
"configWithTargeting": false
}
},
"bidderConfig": {
"bidders": [
"criteo"
],
"config": {
"ortb2": {
"user": {
"ext": {
"consent": {
"source": "sirdata",
"gdprApplies": true
},
"data": {
"eids": [
{
"source": "all-up.com",
"uids": [
{
"id": "d41d8cd98f00b204e9800998ecf8427e",
"atype": 3,
"ext": {
"stype": "hemmd5"
}
},
{
"id": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"atype": 3,
"ext": {
"stype": "hemsha256"
}
}
]
}
]
}
}
}
}
}
}
});
pbjs.addAdUnits(adUnits);
requestBids();
});
setTimeout(() => { sendAdserverRequest(); }, FAILSAFE_TIMEOUT);
|