problema e ca nu merge la jucatori care au steam id de 10 cifre gen STEAMID_0:1:0123456789
asa arata codul
Code: Select all
new AuthID[MAX_PLAYERS + 1][34]
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
Code: Select all
new AuthID[MAX_PLAYERS + 1][34]
Code: Select all
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <ColorChat>
#include <nvault>
#include <hamsandwich>
#define PLUGIN "WarGods"
#define VERSION "3.0"
#define AUTHOR "lexzor"
#define ADMIN_FLAG ADMIN_LEVEL_D
new const tag[] = "JoiNET"
new const reason[] = "Leaving while was under a WarGods request"
new bool:Scanning[32]
new scanned[10]
new iTeam[32]
new SyncHudMessage;
new message[256]
new vaultdata[256]
new const nVaultName[] = "wargods"
new nVault
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("amx_scan", "scan")
register_clcmd("amx_clean", "clean")
register_clcmd("amx_info", "infowargods")
register_clcmd("amx_resetscans", "resetscans")
register_clcmd("amx_getscans", "getscans")
SyncHudMessage = CreateHudSyncObj( );
nVault = nvault_open(nVaultName)
if ( nVault == INVALID_HANDLE )
set_fail_state("[WARGODS] NVault file can't be opened!")
}
public scan(id){
if(get_user_flags(id) & ADMIN_FLAG){
new arg[32]
read_argv(1, arg, charsmax(arg))
new player = cmd_target(id, arg, 2)
if (player){
new aName[32]
new pName[32]
get_user_name(id, aName, charsmax(aName))
get_user_name(player, pName, charsmax(pName))
Scanning[player] = true
ColorChat(0, GREEN, "^x04[%s]^x01 Admin^x04 %s^x01 is requesting an WarGods from^x04 %s^x01!", tag, aName, pName)
set_task( 1.0, "hudmsg", player, _, _, "b", 0 );
iTeam[player] = get_user_team(player)
if(is_user_alive(player))
user_kill(player)
cs_set_user_team(player, CS_TEAM_SPECTATOR)
} else if (!player){
ColorChat(id, GREEN, "^x04[%s]^x01 Player is not online!", tag)
}
}
}
public clean(id){
if(get_user_flags(id) & ADMIN_FLAG){
new arg[32]
read_argv(1, arg, charsmax(arg))
new player = cmd_target(id, arg, 2)
if(player && Scanning[player]){
new AuthID[MAX_PLAYERS + 1][34]
new aName[32], pName[32], szScanned[10], day[10], month[10], year[10], hour[10], minute[10], seconds[10]
get_time("%d", day, charsmax(day))
get_time("%m", month, charsmax(month))
get_time("%Y", year, charsmax(year))
get_time("%H", hour, charsmax(hour))
get_time("%M", minute, charsmax(minute))
get_time("%S", seconds, charsmax(seconds))
Scanning[player] = false
switch(iTeam[player]){
case 1: cs_set_user_team(player, CS_TEAM_T)
case 2: cs_set_user_team(player, CS_TEAM_CT)
}
remove_task(player)
get_user_name(player, pName, charsmax(pName))
get_user_name(id, aName, charsmax(aName))
get_user_authid(player, AuthID[player], charsmax(AuthID[]))
nvault_get(nVault, AuthID[player], vaultdata, charsmax(vaultdata))
replace_all(vaultdata, charsmax(vaultdata), "#", " ")
parse(vaultdata, szScanned, charsmax(szScanned))
if(containi(aName, " "))
replace_all(aName, charsmax(aName), " ", "@")
scanned[player] = str_to_num(szScanned)
scanned[player]++
formatex(vaultdata, charsmax(vaultdata), "%i#%s#%s#%s#%s#%s#%s#%s", scanned[player], day, month, year, hour, minute, seconds, aName)
nvault_set(nVault, AuthID[player], vaultdata)
ColorChat(0, GREEN, "^x04[%s]^x01 Player^x04 %s^x01 is clean and he has been scanned^x04 %i times^x01!", tag, pName, scanned[player])
} else if (player && !Scanning[player]){
new nonscanned[32]
get_user_name(player, nonscanned, charsmax(nonscanned))
ColorChat(id, GREEN, "^x04[%s]^x01 Player^x04 %s^x01 was not asked for a WarGods!", tag, nonscanned)
} else if (!player){
ColorChat(id, GREEN, "^x04[%s]^x01 Player is not online!", tag)
}
}
}
public infowargods(id){
if(get_user_flags(id) & ADMIN_FLAG){
new arg[32]
read_argv(1, arg, charsmax(arg))
new player = cmd_target(id, arg, 2)
if (player){
new AuthID[MAX_PLAYERS + 1][34]
get_user_authid(player, AuthID[player], charsmax(AuthID[]))
new pName[32], szScanned[32], adminname[10], day[10], month[10], year[10], hour[10], minute[10], seconds[10]
nvault_get(nVault, AuthID[player], vaultdata, charsmax(vaultdata))
replace_all(vaultdata, charsmax(vaultdata), "#", " ")
parse(vaultdata, szScanned, charsmax(szScanned), day, charsmax(day), month, charsmax(month), year, charsmax(year), hour, charsmax(hour), minute, charsmax(minute), seconds, charsmax(seconds), adminname, charsmax(adminname))
if(containi(adminname, "@"))
replace_all(adminname, charsmax(adminname), "@", " ")
szScanned[player] = str_to_num(vaultdata)
get_user_name(player, pName, charsmax(pName))
if (szScanned[player] > 0){
ColorChat(id, GREEN, "^x04[%s]^x01 Player^x04 %s^x01 has been scanned^x04 %i times^x01!", tag, pName, szScanned[player])
ColorChat(id, GREEN, "^x04[%s]^x01 Last scan has been made by admin:^x04 %s^x01.",tag, adminname)
ColorChat(id, GREEN, "^x04[%s]^x01 Last scan data:^x04 %s^x01.^x04%s^x01.^x04%s^x01 at^x04 %s^x01:^x04%s^x01:%^x04%s^x01.", tag, day, month, year, hour, minute, seconds)
} else if (szScanned[player] == 0 ){
ColorChat(id, GREEN, "^x04[%s]^x01 Player^x04 %s^x01 has not been scanned!", tag, pName)
}
} else if ( !player ){
ColorChat(id, GREEN, "^x04[%s]^x01 Player is not online!", tag)
}
}
}
public hudmsg(id){
if (Scanning[id] == true){
new name2[32]
get_user_name(id, name2, charsmax(name2))
formatex(message, charsmax(message), "Good luck, %s!^nYou have to do an WarGods and show it to our admin.^nIf you leave you will be permanently banned.", name2)
set_hudmessage( 255, 0, 0, -1.0 , -1.0, 0, 0.0, 1.0, 0.1, 0.1, -1 );
ShowSyncHudMsg( id, SyncHudMessage, message );
}
}
public client_disconnected(id){
if (Scanning[id] == true){
new name[32]
new AuthID[MAX_PLAYERS + 1][34]
get_user_authid(id, AuthID[id], charsmax(AuthID[]))
get_user_name(id, name, charsmax(name))
remove_task(id)
ColorChat(0, GREEN, "^x03[%s]^x01 Player^x03 %s^x01 disconnected during a^x03 WarGods request^x01 and^x03 he was banned^x01 for^x03 2 days^x01!", tag, name)
ColorChat(0, GREEN, "^x03[%s]^x01 SteamID:^x03 %s^x01.", tag, AuthID[id])
server_cmd("amx_addban ^"%s^" ^"%s^" 2880 ^"%s^"", name[id], AuthID[id], reason)
}
}
public resetscans(id){
if( get_user_flags(id) & ADMIN_IMMUNITY ){
new arg[32]
read_argv(1, arg, charsmax(arg))
new player = cmd_target(id, arg, 2)
if(player){
new name[32]
new AuthID[MAX_PLAYERS + 1][34]
get_user_authid(player, AuthID[id], charsmax(AuthID[]))
get_user_name(player, name, charsmax(name))
nvault_remove(nVault, AuthID[id])
ColorChat(id, GREEN, "^x04[%s]^x01 Data of player^x04 %s^x01 has been reseted!", tag, name)
} else if (!player){
ColorChat(id, GREEN, "^x04[%s]^x01 Player is not online!", tag)
}
}
}
public getscans(id){
if(get_user_flags(id) & ADMIN_FLAG){
new arg[32]
read_argv(1, arg, charsmax(arg))
new szScanned, adminname[10], day[10], month[10], year[10], hour[10], minute[10], seconds[10]
nvault_get(nVault, arg, vaultdata, charsmax(vaultdata))
replace_all(vaultdata, charsmax(vaultdata), "#", " ")
parse(vaultdata, szScanned, charsmax(szScanned), day, charsmax(day), month, charsmax(month), year, charsmax(year), hour, charsmax(hour), minute, charsmax(minute), seconds, charsmax(seconds), adminname, charsmax(adminname))
if(containi(adminname, "@"))
replace_all(adminname, charsmax(adminname), "@", " ")
szScanned = str_to_num(vaultdata)
if (szScanned > 0){
ColorChat(id, GREEN, "^x04[%s]^x01 SteamID^x04 %s^x01 has been scanned^x04 %i times^x01!", tag, arg, szScanned)
ColorChat(id, GREEN, "^x04[%s]^x01 Last scan has been made by admin:^x04 %s^x01.",tag, adminname)
ColorChat(id, GREEN, "^x04[%s]^x01 Last scan data:^x04 %s^x01.^x04%s^x01.^x04%s^x01 at^x04 %s^x01:^x04%s^x01:%^x04%s^x01.", tag, day, month, year, hour, minute, seconds)
} else if (szScanned == 0 ){
ColorChat(id, GREEN, "^x04[%s]^x01 SteamID^x04 %s^x01 has not been scanned!", tag, arg)
}
}
}
Code: Select all
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <nvault>
#if AMXX_VERSION_NUM < 183
#include <ColorChat>
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif
#endif
#pragma tabsize 0
//#define BRUTE
static const tag[] = "JoiNET",
reason[] = "Leaving while was under a WarGods request",
nVaultName[] = "wargods",
WGC_PID = 666,
TARGET_ARG = CMDTARGET_NO_BOTS,
ADMIN_FLAG = ADMIN_LEVEL_D,
MINUTE_TO_DAYS = 2,
BAN_TIME = 2880,
PLUGIN[] = "WarGods",
VERSION[] = "3.0",
AUTHOR[] = "lexzor"
new bool:Scanning[MAX_PLAYERS+1],scanned[MAX_PLAYERS+1],CsTeams:iTeam[MAX_PLAYERS+1],SyncHudMessage,vaultdata[256],nVault,g_Nick[MAX_PLAYERS+1][33],g_AuthID[MAX_PLAYERS+1][35]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
nVault = nvault_open(nVaultName)
if ( nVault == INVALID_HANDLE ) set_fail_state("[WARGODS] NVault file can't be opened!")
register_clcmd("amx_scan", "scan", ADMIN_FLAG)
register_clcmd("amx_clean", "clean",ADMIN_FLAG)
register_clcmd("amx_info", "infowargods",ADMIN_FLAG)
register_clcmd("amx_resetscans", "resetscans",ADMIN_FLAG)
SyncHudMessage = CreateHudSyncObj( );
}
public plugin_end() if ( nVault != INVALID_HANDLE ) nvault_close(nVault)
public client_authorized(id){
get_user_name(id,g_Nick[id],charsmax(g_Nick[]))
get_user_authid(id,g_AuthID[id],charsmax(g_AuthID[]))
}
public client_putinserver(id){
if(is_user_bot(id)||is_user_hltv(id)||!is_user_connected(id)) return
Scanning[id]=false
scanned[id]=0
iTeam[id]=CS_TEAM_UNASSIGNED
}
#if AMXX_VERSION_NUM < 183
public client_disconnect(id){
#else
public client_disconnected(id){
#endif
if (Scanning[id]){
client_print_color(0,id, "^3[%s]^3 %s^1 disconnected during a^4 WarGods request^1 and^4 he was banned^1 for^4 %d day%s^1!", tag, g_Nick[id],MINUTE_TO_DAYS,MINUTE_TO_DAYS==1?"":"s")
client_print_color(0,id, "^3[%s]^1 SteamID:^3 %s^1.", tag, g_AuthID[id])
server_cmd("amx_addban ^"%s^" ^"%s^" %d ^"%s^"", g_Nick[id], g_AuthID[id], BAN_TIME, reason)
}
if(task_exists(id+WGC_PID)) remove_task(id+WGC_PID)
Scanning[id]=false
scanned[id]=0
iTeam[id]=CS_TEAM_UNASSIGNED
}
public scan(id,level,cid){
if(!cmd_access(id,level,cid,1)) return 1
static arg[35];read_argv(1, arg, charsmax(arg))
static player; player = cmd_target(id, arg, TARGET_ARG)
if (player&&is_user_connected(player)){
Scanning[player] = true
client_print_color(0,id, "^4[%s]^3 %s^1 is requesting an WarGods from^4 %s^1!", tag, g_Nick[id], g_Nick[player])
iTeam[player] = cs_get_user_team(player)
if(is_user_alive(player)) user_silentkill(player)
cs_set_user_team(player, CS_TEAM_SPECTATOR)
set_task( 1.0, "hudmsg", player+WGC_PID, .flags= "b" );
} else client_print_color(id,print_team_default, "^4[%s]^1 Player is not online!", tag)
return 1
}
public hudmsg(id){
id-=WGC_PID
if(!Scanning[id]||!is_user_connected(id)){
remove_task(id)
return
}
static message[250]
formatex(message, charsmax(message), "Good luck, %s!^nYou have to do an WarGods and show it to our admin.^nIf you leave you will be banned 2 days.", g_Nick[id])
set_hudmessage( 255, 0, 0, -1.0 , -1.0, 0, 0.0, 1.0, 0.1, 0.1, -1 );
ShowSyncHudMsg( id, SyncHudMessage, message );
}
public clean(id,level,cid){
if(!cmd_access(id,level,cid,1)) return 1
static arg[33];read_argv(1, arg, charsmax(arg))
static player; player = cmd_target(id, arg, TARGET_ARG)
if (!player||!is_user_connected(player)){
client_print_color(id,print_team_default, "^4[%s]^1 Player is not online!", tag)
return 1
}
if (!Scanning[player]){
client_print_color(id,player, "^4[%s]^3 %s^1 was not asked for a WarGods!", tag, g_Nick[player])
return 1
}
static hr,mine,se,yr,mo,dy, szScanned[10]
time(hr,mine,se)
date(yr,mo,dy)
Scanning[player] = false
switch(iTeam[player]){
case CS_TEAM_T: cs_set_user_team(player, CS_TEAM_T)
case CS_TEAM_CT: cs_set_user_team(player, CS_TEAM_CT)
}
if(task_exists(player+WGC_PID)) remove_task(player+WGC_PID)
static iTS
if(nvault_lookup(nVault, g_Nick[player], vaultdata, charsmax(vaultdata),iTS)){
parse(vaultdata, szScanned, charsmax(szScanned))
scanned[player] = str_to_num(szScanned)
scanned[player]++
} else scanned[player]=0
formatex(vaultdata, charsmax(vaultdata), "^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%d^" ^"%s^"", scanned[player], dy, mo, yr, hr, mine, se, g_Nick[id])
nvault_set(nVault, g_Nick[player], vaultdata)
client_print_color(0,player, "^4[%s]^3 %s^1 is clean and he has been scanned^4 %d time%s^1!", tag, g_Nick[player], scanned[player],scanned[player]==1?"":"s")
return 1
}
public infowargods(id,level,cid){
if(!cmd_access(id,level,cid,1)) return 1
static arg[35]
read_argv(1, arg, charsmax(arg))
static player; player = cmd_target(id, arg, TARGET_ARG)
if ( !player ){
client_print_color(id,print_team_default, "^4[%s]^1 Player is not online!", tag)
return 1
}
static szScanned[10], adminname[33], day[10], month[10], year[10], hour[10], minute[10], seconds[10],iTS,
lAN[33], lDY, lMO, lYR, lHR, lMN, lSE
if(nvault_lookup(nVault, g_Nick[player], vaultdata, charsmax(vaultdata),iTS)){
parse(vaultdata, szScanned, charsmax(szScanned), day, charsmax(day), month, charsmax(month), year, charsmax(year), hour, charsmax(hour), minute, charsmax(minute), seconds, charsmax(seconds), adminname, charsmax(adminname))
scanned[player] = str_to_num(szScanned)
lDY=str_to_num(day)
lMO=str_to_num(month)
lYR=str_to_num(year)
lHR=str_to_num(hour)
lMN=str_to_num(minute)
lSE=str_to_num(seconds)
copy(lAN,charsmax(lAN),adminname)
} else{
client_print_color(id,print_team_default, "^4[%s]^1 Player is not nvault!", tag)
return 1
}
if (scanned[player] > 0){
client_print_color(id,player, "^4[%s]^3 %s^1 has been scanned^4 %d time%s^1!", tag, g_Nick[player], scanned[player],scanned[player]==1?"":"s")
client_print_color(id,print_team_default, "^4[%s]^1 Last scan has been made by admin:^4 %s^1.",tag, lAN)
client_print_color(id,print_team_default, "^4[%s]^1 Last scan data:^4 %d^1.^4%d^1.^4%d^1 at^4 %d^1:^4%d^1:%^4%d^1.", tag, lDY, lMO, lYR, lHR, lMN, lSE)
} else client_print_color(id,player, "^4[%s]^3 %s^1 has not been scanned!", tag, g_Nick[player])
return 1
}
public resetscans(id,level,cid){
if(!cmd_access(id,level,cid,1)) return 1
static arg[35];read_argv(1, arg, charsmax(arg))
static player; player = cmd_target(id, arg, TARGET_ARG)
if (!player){
client_print_color(id,print_team_default, "^4[%s]^1 Player is not online!", tag)
return 1
}
#if defined BRUTE
if(!nvault_get(nVault,g_Nick[player])){
client_print_color(id,print_team_default, "^4[%s]^1 Player is not in nvault!", taag)
return 1
}
#endif
nvault_remove(nVault, g_Nick[player])
client_print_color(id,player, "^4[%s]^1 Data of^3 %s^1 has been reseted!", tag, g_Nick[player])
return 1
}