Правила форума
1. Запрещено материться и оскорблять других участников форума. 2. Запрещен флуд, оффтоп, дабл постинг во всех разделах форума, кроме раздела "Болтовня". 3. Запрещено взламывать сайт/форум или наносить любой вред проекту. 4. Запрещено рекламировать другие ресурсы. 5. Запрещено создавать темы без информативного названия. Название темы должно отображать ее смысл.
Парни, серву 1 год, такой шняги небыло никогда, CSF стоит пропатченый с офф сайта, поставил через полгода когда узнал про дырку. Мне один юзер написал в чат мой ркон и рассказал про дырку. Могу подсказать мои подозрения, совсем недавно поставил несколько плагинов, после чего это и началось. deagsmapmanager.amxx resetscore.amxx ad_manager.amxx clockmaker_v1.1.amxx multilingual.amxx amx_parachute.amxx timelimitvote_rus.amxx c4timer.amxx follow_the_wounded.amxx
0.1 Release 0.1.1 Players can't buy a parachute if they already own one 0.1.2 Release for AMX MOD X 0.1.3 Minor changes 0.1.4 Players lose their parachute if they die 0.1.5 Added amx_parachute cvar 0.1.6 Changed set_origin to movetype_follow (you won't see your own parachute) 0.1.7 Added amx_parachute <name> | admins with admin level a get a free parachute 0.1.8 JTP - Cleaned up code, fixed runtime error 1.0 JTP - Should be final version, made it work on basically any mod 1.1 JTP - Added Changes from AMX Version 0.1.8 Added say give_parachute and parachute_fallspeed cvar Plays the release animation when you touch the ground Added chat responder for automatic help 1.2 JTP - Added cvar to disable the detach animation Redid animation code to improve organization Force "walk" animation on players when falling Change users gravity when falling to avoid choppiness 1.3 JTP - Upgraded to pCVARs
Commands:
say buy_parachute - buys a parachute (CStrike ONLY) saw sell_parachute - sells your parachute (75% of the purchase price) say give_parachute <nick, #userid or @team> - gives your parachute to the player
amx_parachute <nick, #userid or @team> - gives a player a free parachute (CStrike ONLY) amx_parachute @all - gives everyone a free parachute (CStrike ONLY)
Press +use to slow down your fall.
Cvars:
sv_parachute "1" - 0: disables the plugin - 1: enables the plugin
parachute_cost "1000" - cost of the parachute (CStrike ONLY)
parachute_payback "75" - how many percent of the parachute cost you get when you sell your parachute (ie. (75/100) * 1000 = 750$)
parachute_fallspeed "100" - speed of the fall when you use the parachute
Setup (AMXX 1.x):
Install the amxx file. Enable engine and cstrike (for cs only) in the amxx modules.ini Put the parachute.mdl file in the modname/models/ folder
public HandleSay(id) { if(!is_user_connected(id)) return PLUGIN_CONTINUE
new args[128] read_args(args, 127) remove_quotes(args)
if (gCStrike) { if (equali(args, "buy_parachute")) { buy_parachute(id) return PLUGIN_HANDLED } else if (equali(args, "sell_parachute")) { sell_parachute(id) return PLUGIN_HANDLED } else if (containi(args, "give_parachute") == 0) { give_parachute(id,args[15]) return PLUGIN_HANDLED } }
if (containi(args, "parachute") != -1) { if (gCStrike) client_print(id, print_chat, "[AMXX] Parachute commands: buy_parachute, sell_parachute, give_parachute") client_print(id, print_chat, "[AMXX] To use your parachute press and hold your +use button while falling") }
return PLUGIN_CONTINUE }
public buy_parachute(id) { if (!gCStrike) return PLUGIN_CONTINUE if (!is_user_connected(id)) return PLUGIN_CONTINUE
if (!get_pcvar_num(pEnabled)) { client_print(id, print_chat, "[AMXX] Parachute plugin is disabled") return PLUGIN_HANDLED }
if (has_parachute[id]) { client_print(id, print_chat, "[AMXX] You already have a parachute") return PLUGIN_HANDLED }
new money = cs_get_user_money(id) new cost = get_pcvar_num(pCost)
if (money < cost) { client_print(id, print_chat, "[AMXX] You don't have enough moneyfor a parachute - Costs $%i", cost) return PLUGIN_HANDLED }
cs_set_user_money(id, money - cost) client_print(id, print_chat, "[AMXX] You have bought a parachute. To use it, press +use while falling.") has_parachute[id] = true
return PLUGIN_HANDLED }
public sell_parachute(id) { if (!gCStrike) return PLUGIN_CONTINUE if (!is_user_connected(id)) return PLUGIN_CONTINUE
if (!get_pcvar_num(pEnabled)) { client_print(id, print_chat, "[AMXX] Parachute plugin is disabled") return PLUGIN_HANDLED }
if (!has_parachute[id]) { client_print(id, print_chat, "[AMXX] You don't have a parachute to sell") return PLUGIN_HANDLED }
if (access(id,PARACHUTE_LEVEL)) { client_print(id, print_chat, "[AMXX] You cannot sell your free admin parachute") return PLUGIN_HANDLED }
parachute_reset(id)
new money = cs_get_user_money(id) new cost = get_pcvar_num(pCost)
client_print(id, print_chat, "[AMX] You have sold your used parachute for $%d", sellamt)
return PLUGIN_CONTINUE }
public give_parachute(id,args[]) { if (!gCStrike) return PLUGIN_CONTINUE if (!is_user_connected(id)) return PLUGIN_CONTINUE
if (!get_pcvar_num(pEnabled)) { client_print(id, print_chat, "[AMXX] Parachute plugin is disabled") return PLUGIN_HANDLED }
if (!has_parachute[id]) { client_print(id, print_chat, "[AMXX] You don't have a parachute to give") return PLUGIN_HANDLED }
new player = cmd_target(id, args, 4) if (!player) return PLUGIN_HANDLED
new id_name[32], pl_name[32] get_user_name(id, id_name, 31) get_user_name(player, pl_name, 31)
if(has_parachute[player]) { client_print(id, print_chat, "[AMXX] %s already has a parachute.", pl_name) return PLUGIN_HANDLED }
parachute_reset(id) has_parachute[player] = true
client_print(id, print_chat, "[AMXX] You have given your parachute to %s.", pl_name) client_print(player, print_chat, "[AMXX] %s has given thier parachute to you.", id_name)
if (!get_pcvar_num(pEnabled)) { client_print(id, print_chat, "[AMXX] Parachute plugin is disabled") return PLUGIN_HANDLED }
new arg[32], name[32], name2[32], authid[35], authid2[35] read_argv(1,arg,31) get_user_name(id,name,31) get_user_authid(id,authid,34)
if (arg[0]=='@'){ new players[32], inum if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST") if (equali("ALL",arg[1])) get_players(players,inum) else get_players(players,inum,"e",arg[1])
if (inum == 0) { console_print(id,"No clients in such team") return PLUGIN_HANDLED }
for(new a = 0; a < inum; a++) { has_parachute[players[a]] = true }
switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"ADMIN %s: gave a parachute to ^"%s^" players",name,arg[1]) case 1: client_print(0,print_chat,"ADMIN: gave a parachute to ^"%s^" players",arg[1]) }
console_print(id,"[AMXX] You gave a parachute to ^"%s^" players",arg[1]) log_amx("^"%s<%d><%s><>^" gave a parachute to ^"%s^"", name,get_user_userid(id),authid,arg[1]) } else {
new player = cmd_target(id,arg,6) if (!player) return PLUGIN_HANDLED
switch(get_cvar_num("amx_show_activity")) { case 2: client_print(0,print_chat,"ADMIN %s: gave a parachute to ^"%s^"",name,name2) case 1: client_print(0,print_chat,"ADMIN: gave a parachute to ^"%s^"",name2) }
console_print(id,"[AMXX] You gave a parachute to ^"%s^"", name2) log_amx("^"%s<%d><%s><>^" gave a parachute to ^"%s<%d><%s><>^"", name,get_user_userid(id),authid,name2,get_user_userid(player),authid2) } return PLUGIN_HANDLED }
public death_event() { new id = read_data(2) if(g_isDying[id]) { g_isDying[id] = false remove_task(4247545+id) } }
public make_footsteps(param[]) { new id = param[0] if(!is_user_alive(id) || get_cvar_num("ftw_active") == 0 || get_speed(id) < 120) return new origin[3] get_user_origin(id, origin) if(entity_get_int(id, EV_INT_bInDuck) == 1) origin[2] -= 18 else origin[2] -= 36 new Float:velocity[3] new Float:ent_angles[3] new Float:ent_origin[3] new ent
#define PLUGIN "Clock Maker" #define VERSION "1.1" #define AUTHOR "Necro"
#define ADMIN_LEVEL ADMIN_MENU //admin access level to use this plugin. ADMIN_MENU = flag 'u' #define MAIN_MENU_KEYS (1<<0)|(1<<1)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<9)
/* enum for menu selections */ enum { N1, N2, N3, N4, N5, N6, N7, N8, N9, N0 }; new const X = 0; new const Y = 1; new const Z = 2; //for some reason I got tag mismatch on Z when using an enum
new gszMainMenuText[256]; new const gszClockFaces[] = "sprites/clock_faces.spr"; new const gszClockDigits[] = "sprites/clock_digits.spr"; new const gszPrefix[] = "[CM] "; new const gszInfoTarget[] = "info_target"; new const gszClockClassname[] = "cm_clock"; new const gszClockDigitClassname[] = "cm_clockdigit"; new const Float:gfDigitOffsetMultipliers[4] = {0.725, 0.275, 0.3, 0.75}; new const Float:gfClockSize[2] = {80.0, 32.0}; new const Float:gfTitleSize = 16.0;
new gszTime[5]; new gszFile[128]; new gTimeOffsetOld; new gHourTypeOld;
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR);
//CVARs register_cvar("cm_hourtype", "1"); //0: 12 hour, 1: 24 hour register_cvar("cm_hourannounce", "1"); //say the hour on the hour register_cvar("cm_timeoffset", "0"); //offset the time to a different timezone +/- hours
public plugin_precache() { precache_model(gszClockFaces); precache_model(gszClockDigits); }
public plugin_cfg() { //create the main menu new size = sizeof(gszMainMenuText); add(gszMainMenuText, size, "\yClock Maker Menu^n^n"); add(gszMainMenuText, size, "\r1. \wCreate server time clock^n"); add(gszMainMenuText, size, "\r2. \wCreate map timeleft clock^n^n"); add(gszMainMenuText, size, "\r4. \wDelete clock^n^n"); add(gszMainMenuText, size, "\r5. \wMake larger^n"); add(gszMainMenuText, size, "\r6. \wMake smaller^n^n"); add(gszMainMenuText, size, "\r7. \wSave clocks^n"); add(gszMainMenuText, size, "\r8. \wLoad clocks^n^n"); add(gszMainMenuText, size, "\r0. \wClose^n");
//store current CVAR values (so we can check if they get changed) gTimeOffsetOld = get_cvar_num("cm_timeoffset"); gHourTypeOld = get_cvar_num("cm_hourtype");
//make save folder in basedir new szDir[64]; new szMap[32];
//set a task to update the clocks (every second is frequent enough) set_task(1.0, "taskUpdateClocks", 0, "", 0, "b"); }
public taskUpdateClocks() { new clock = -1;
//get the time digits new serverTimeDigits[4]; new timeleftDigits[4]; new bool:bUpdateServerTime = getTimeDigits(CM_SERVERTIME, serverTimeDigits); getTimeDigits(CM_MAPTIMELEFT, timeleftDigits);
//find all clock entities while ((clock = find_ent_by_class(clock, gszClockClassname))) { //get the clock type new clockType = entity_get_int(clock, EV_INT_groupinfo);
//if the time changed for this clocktype if (clockType == CM_SERVERTIME) { if (bUpdateServerTime) { //set the clock to the correct time set_clock_digits(clock, serverTimeDigits); } } else if (clockType == CM_MAPTIMELEFT) { //set the clock to show the timeleft set_clock_digits(clock, timeleftDigits); } }
//check to see if its on the hour if (bUpdateServerTime) { new hour, mins; time(hour, mins);
//if its on the hour then alert if (mins == 0) { alertHour(hour); } } }
public showClockMenu(id) { //show the main menu to the player show_menu(id, MAIN_MENU_KEYS, gszMainMenuText, -1, "clockMainMenu");
return PLUGIN_HANDLED; }
public handleMainMenu(id, num) { switch (num) { case N1: createClockAiming(id, CM_SERVERTIME); case N2: createClockAiming(id, CM_MAPTIMELEFT); case N4: deleteClockAiming(id); case N5: scaleClockAiming(id, 0.1); case N6: scaleClockAiming(id, -0.1); case N7: saveClocks(id); case N8: loadClocks(id); }
//show menu again if (num != N0) { showClockMenu(id); }
return PLUGIN_HANDLED; }
createClockAiming(id, clockType) { //make sure player has access to this command if (get_user_flags(id) & ADMIN_LEVEL) { new origin[3]; new Float:vOrigin[3]; new Float:vAngles[3]; new Float:vNormal[3];
//get the origin of where the player is aiming get_user_origin(id, origin, 3); IVecFVec(origin, vOrigin);
new bool:bSuccess = traceClockAngles(id, vAngles, vNormal, 1000.0);
//if the trace was successfull if (bSuccess) { //if the plane the trace hit is vertical if (vNormal[2] == 0.0) { //create the clock new bool:bSuccess = createClock(clockType, vOrigin, vAngles, vNormal);
//if clock created successfully if (bSuccess) { client_print(id, print_chat, "%sCreated clock", gszPrefix); } } else { client_print(id, print_chat, "%sYou must place the clock on a vertical wall!", gszPrefix); } } else { client_print(id, print_chat, "%sMove closer to the target to create the clock", gszPrefix); } } }
bool:createClock(clockType, Float:vOrigin[3], Float:vAngles[3], Float:vNormal[3], Float:fScale = 1.0) { new clock = create_entity(gszInfoTarget); new digit[4]; new bool:bFailed = false;
//create 4 new entities to use for digits on the clock for (new i = 0; i < 4; ++i) { digit[i] = create_entity(gszInfoTarget);
//if failed boolean is false and entity failed to create if (!bFailed && !is_valid_ent(digit[i])) { bFailed = true; break; } }
//make sure all entities were created successfully if (is_valid_ent(clock) && !bFailed) { //adjust the origin to lift the clock off the wall (prevent flickering) vOrigin[0] += (vNormal[0] * 0.5); vOrigin[1] += (vNormal[1] * 0.5); vOrigin[2] += (vNormal[2] * 0.5);
//set the entity frame (clock face) depending on the clock type switch (clockType) { case CM_SERVERTIME: entity_set_float(clock, EV_FL_frame, 0.0); case CM_MAPTIMELEFT: entity_set_float(clock, EV_FL_frame, 1.0); }
//link the digits entities to the clock entity_set_int(clock, EV_INT_iuser1, digit[0]); entity_set_int(clock, EV_INT_iuser2, digit[1]); entity_set_int(clock, EV_INT_iuser3, digit[2]); entity_set_int(clock, EV_INT_iuser4, digit[3]);
new digitValues[4];
//setup the digits to make up the time for (new i = 0; i < 4; ++i) { //setup digit properties entity_set_string(digit[i], EV_SZ_classname, gszClockDigitClassname); entity_set_vector(digit[i], EV_VEC_angles, vAngles); entity_set_model(digit[i], gszClockDigits); entity_set_float(digit[i], EV_FL_scale, fScale);
//set digit position set_digit_origin(i, digit[i], vOrigin, vNormal, fScale);
//get the time digits getTimeDigits(clockType, digitValues);
//set the in-game clocks digits set_clock_digits(clock, digitValues); }
return true; } else { //delete clock face if it created successfully if (is_valid_ent(clock)) { remove_entity(clock); }
//iterate though the entity array and delete whichever ones created successfully for (new i = 0; i < 4; ++i) { if (is_valid_ent(digit[i])) { remove_entity(digit[i]); } } }
return false; }
deleteClockAiming(id) { new bool:bDeleted; new clock = get_clock_aiming(id);
if (clock) { //delete the clock bDeleted = deleteClock(clock);
//if the clock was deleted successfully if (bDeleted) { client_print(id, print_chat, "%sDeleted clock", gszPrefix); } } }
bool:deleteClock(ent) { //if the entity is a clock if (isClock(ent)) { //get entity IDs of digits on the clock new digit[4]; digit[0] = entity_get_int(ent, EV_INT_iuser1); digit[1] = entity_get_int(ent, EV_INT_iuser2); digit[2] = entity_get_int(ent, EV_INT_iuser3); digit[3] = entity_get_int(ent, EV_INT_iuser4);
//delete the digits on the clock if they're valid if (is_valid_ent(digit[0])) remove_entity(digit[0]); if (is_valid_ent(digit[1])) remove_entity(digit[1]); if (is_valid_ent(digit[2])) remove_entity(digit[2]); if (is_valid_ent(digit[3])) remove_entity(digit[3]);
//delete the clock face remove_entity(ent);
//successfully deleted the clock return true; }
return false; }
scaleClockAiming(id, Float:fScaleAmount) { //get the clock the player is aiming at (if any) new clock = get_clock_aiming(id);
//if player is aiming at a clock if (clock) { //get the clocks digit entities new digit[4]; new bSuccess = get_clock_digits(clock, digit);
//if successfully got clocks digit entities if (bSuccess) { new Float:vOrigin[3]; new Float:vNormal[3]; new Float:vAngles[3];
//get the clocks current scale and add on the specified amount new Float:fScale = entity_get_float(clock, EV_FL_scale); fScale += fScaleAmount;
//make sure the scale isn't negative if (fScale > 0.01) { //set the clocks scale entity_set_float(clock, EV_FL_scale, fScale);
//get the clocks origin and angles entity_get_vector(clock, EV_VEC_origin, vOrigin); entity_get_vector(clock, EV_VEC_angles, vAngles);
//get the clocks normal vector from the angles angle_vector(vAngles, ANGLEVECTOR_FORWARD, vNormal);
//set the normal to point in the opposite direction vNormal[0] = -vNormal[0]; vNormal[1] = -vNormal[1]; vNormal[2] = -vNormal[2];
//enlarge the clocks digits by the specified amount for (new i = 0; i < 4; ++i) { //set the digits scale entity_set_float(digit[i], EV_FL_scale, fScale);
//adjust the digits origin because of the new scale set_digit_origin(i, digit[i], vOrigin, vNormal, fScale); } } } } }
saveClocks(id) { //make sure player has access to this command if (get_user_flags(id) & ADMIN_LEVEL) { new ent = -1; new Float:vOrigin[3]; new Float:vAngles[3]; new Float:fScale; new clockCount = 0; new szData[128];
//open file for writing new file = fopen(gszFile, "wt"); new clockType;
//format clock info and save it to file formatex(szData, 128, "%c %f %f %f %f %f %f %f^n", gClockSaveIds[clockType], vOrigin[0], vOrigin[1], vOrigin[2], vAngles[0], vAngles[1], vAngles[2], fScale); fputs(file, szData);
//increment clock count ++clockCount; }
//get players name new szName[32]; get_user_name(id, szName, 32);
//notify all admins that the player saved clocks to file for (new i = 1; i <= 32; ++i) { //make sure player is connected if (is_user_connected(i)) { if (get_user_flags(i) & ADMIN_LEVEL) { client_print(i, print_chat, "%s'%s' saved %d clock%s to file!", gszPrefix, szName, clockCount, (clockCount == 1 ? "" : "s")); } } }
//close file fclose(file); } }
loadClocks(id) { //if the clock save file exists if (file_exists(gszFile)) { new szData[128]; new szType[2]; new oX[13], oY[13], oZ[13]; new aX[13], aY[13], aZ[13]; new szScale[13]; new Float:vOrigin[3]; new Float:vAngles[3]; new Float:vNormal[3]; new Float:fScale; new clockCount = 0;
//open the file for reading new file = fopen(gszFile, "rt");
//iterate through all the lines in the file while (!feof(file)) { szType = ""; fgets(file, szData, 128); parse(szData, szType, 2, oX, 12, oY, 12, oZ, 12, aX, 12, aY, 12, aZ, 12, szScale, 12);
if (strlen(szType) > 0) { //get the normal vector from the angles angle_vector(vAngles, ANGLEVECTOR_FORWARD, vNormal);
//set the normal to point in the opposite direction vNormal[0] = -vNormal[0]; vNormal[1] = -vNormal[1]; vNormal[2] = -vNormal[2];
//create the clock depending on the clock type switch (szType[0]) { case 'C': createClock(CM_SERVERTIME, vOrigin, vAngles, vNormal, fScale); case 'T': createClock(CM_MAPTIMELEFT, vOrigin, vAngles, vNormal, fScale); }
++clockCount; } }
//close the file fclose(file);
//if a player is loading the clocks if (id > 0 && id <= 32) { //get players name new szName[32]; get_user_name(id, szName, 32);
//notify all admins that the player loaded clocks from file for (new i = 1; i <= 32; ++i) { //make sure player is connected if (is_user_connected(i)) { if (get_user_flags(i) & ADMIN_LEVEL) { client_print(i, print_chat, "%s'%s' loaded %d clock%s from file!", gszPrefix, szName, clockCount, (clockCount == 1 ? "" : "s")); } } } } } }
get_clock_aiming(id) { //get hit point for where player is aiming new origin[3]; new Float:vOrigin[3]; get_user_origin(id, origin, 3); IVecFVec(origin, vOrigin);
new ent = -1;
//find all entities within a 2 unit sphere while ((ent = find_ent_in_sphere(ent, vOrigin, 2.0))) { //if entity is a clock if (isClock(ent)) { return ent; } }
return 0; }
bool:traceClockAngles(id, Float:vAngles[3], Float:vNormal[3], Float:fDistance) { //get players origin and add on their view offset new Float:vPlayerOrigin[3]; new Float:vViewOfs[3]; entity_get_vector(id, EV_VEC_origin, vPlayerOrigin); entity_get_vector(id, EV_VEC_view_ofs, vViewOfs); vPlayerOrigin[0] += vViewOfs[0]; vPlayerOrigin[1] += vViewOfs[1]; vPlayerOrigin[2] += vViewOfs[2];
//calculate the end point for trace using the players view angle new Float:vAiming[3]; entity_get_vector(id, EV_VEC_v_angle, vAngles); vAiming[0] = vPlayerOrigin[0] + floatcos(vAngles[1], degrees) * fDistance; vAiming[1] = vPlayerOrigin[1] + floatsin(vAngles[1], degrees) * fDistance; vAiming[2] = vPlayerOrigin[2] + floatsin(-vAngles[0], degrees) * fDistance;
//trace a line and get the normal for the plane it hits new trace = trace_normal(id, vPlayerOrigin, vAiming, vNormal);
//convert the normal into an angle vector vector_to_angle(vNormal, vAngles);
//spin the angle vector 180 degrees around the Y axis vAngles[1] += 180.0; if (vAngles[1] >= 360.0) vAngles[1] -= 360.0;
return bool:trace; }
set_digit_origin(i, digit, Float:vOrigin[3], Float:vNormal[3], Float:fScale) { //make sure the digit entity is valid if (is_valid_ent(digit)) { new Float:vDigitNormal[3]; new Float:vPos[3]; new Float:fVal;
//change the normals to get the left and right depending on the digit vDigitNormal = vNormal; if (i == 0 || i == 1) vDigitNormal[X] = -vDigitNormal[X]; if (i == 2 || i == 3) vDigitNormal[Y] = -vDigitNormal[Y];
//bring digit sprites forwards off the clock face to prevent flickering vPos[0] += (vNormal[0] * 0.5); vPos[1] += (vNormal[1] * 0.5); vPos[2] += (vNormal[2] * 0.5);
//set the digits origin entity_set_origin(digit, vPos); } }
bool:getTimeDigits(clockType, digitValues[4]) { switch (clockType) { case CM_SERVERTIME: { new bool:bChanged = false; new szTime[5]; new timeOffset = get_cvar_num("cm_timeoffset"); new hourType = get_cvar_num("cm_hourtype");
//get the time new hour, mins; time(hour, mins);
//add on the time offset hour += timeOffset;
//make sure hour hasnt gone out of bounds while (hour < 0) { hour += 24; }
while (hour >= 24) { hour -= 24; }
//if server is set to use 12 hour clocks if (hourType == 0) { if (hour > 12) { hour -= 12; } }
//format the time into a string format(szTime, 4, "%s%d%s%d", (hour < 10 ? "0" : ""), hour, (mins < 10 ? "0" : ""), mins);
//if the time has changed if (!equal(gszTime, szTime)) { gszTime = szTime; bChanged = true; }
//if the hour type has changed if (hourType != gHourTypeOld) { gHourTypeOld = hourType; bChanged = true; }
//if the time offset value has changed if (timeOffset != gTimeOffsetOld) { gTimeOffsetOld = timeOffset; bChanged = true; }
return bChanged; }
case CM_MAPTIMELEFT: { //get timeleft on map and calculate the minutes and seconds new timeleft = get_timeleft(); new mins = timeleft / 60; new secs = timeleft % 60;
//format the timeleft into a string new szTime[5]; format(szTime, 4, "%s%d%s%d", (mins < 10 ? "0" : ""), mins, (secs < 10 ? "0" : ""), secs);
bool:get_clock_digits(clock, digit[4]) { //if the entity is a clock if (isClock(clock)) { //get entity IDs of digits on the clock digit[0] = entity_get_int(clock, EV_INT_iuser1); digit[1] = entity_get_int(clock, EV_INT_iuser2); digit[2] = entity_get_int(clock, EV_INT_iuser3); digit[3] = entity_get_int(clock, EV_INT_iuser4);
//make sure all the clock digits are valid for (new i = 0; i < 4; ++i) { if (!is_valid_ent(digit[i])) { log_amx("%sInvalid digit entity in clock", gszPrefix);
return false; } } }
return true; }
set_clock_digits(clock, digitValues[4]) { //get the clocks digit entities new digits[4]; new bool:bSuccess = get_clock_digits(clock, digits);
alertHour(hour) { //if we're set to speak the hour if (get_cvar_num("cm_hourannounce") > 0) { new szMeridiem[4] = "am"; new szHour[16];
//setup hour. Make sure hour isn't above 12 and isn't 00 o'clock if (hour >= 12) szMeridiem = "pm"; if (hour > 12) hour -= 12; if (hour == 0) hour = 12;
//get the hour as a word num_to_word(hour, szHour, 15);
//speak the time client_cmd(0, "spk ^"fvox/bell _period %s %s^"", szHour, szMeridiem); } }
bool:isClock(ent) { //if entity is valid if (is_valid_ent(ent)) { //get classname of entity new szClassname[32]; entity_get_string(ent, EV_SZ_classname, szClassname, 32);
//if classname of entity matches global clock classname if (equal(szClassname, gszClockClassname)) { //entity is a clock return true; } }
Кто выдаст? Сервер? Нормально работает дальше, я его и отключил, что подумал что rcon тырят. Но в логах нет ни rcon команд, ни входов других админов, просто: L 11/05/2011 - 22:54:08: [admincmd_reason.amxx] Ban: "nick<3101><STEAM_0:0:41987944><>" ban and kick "nG_d1mt1x<3112><STEAM_0:0:1025706507><>" (minutes "0") (reason "") НЕкто "nG_d1mt1x" банит админа на всегда, но он не логинился как админ. Значит он небыл админом, а просто послал команду на бан.
В парашуте упоминается админ Я не програмист, но чую тут есть подвох (#define PARACHUTE_LEVEL ADMIN_LEVEL_A)
Во-первых, на все плагины у тебя должны быть исходники. Во-вторых, все эти исходники надо компилить самому через amx-x.ru, оф.сайт или локально. В-третьих, что это за плагин admincmd_reason.amxx? Исходники в студию.
Не пишите мне в ЛС: если вам нужна помощь на бесплатной основе. Любые вопросы на форум.
/* AMX Mod X * Admin Commands Plugin * * by the AMX Mod X Development Team * originally developed by OLO * * This file is part of AMX Mod X. * * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. */
new g_cvarRcon[MAXRCONCVARS][32] new g_cvarRconNum new g_pauseCon new Float:g_pausAble new bool:g_Paused new bool:g_PauseAllowed = false new g_addCvar[] = "amx_cvar add %s"
public plugin_init() { register_plugin("Admin Commands", AMXX_VERSION_STR, "AMXX Dev Team") register_dictionary("admincmd.txt") register_dictionary("common.txt") register_concmd("amx_kick", "cmdKick", ADMIN_KICK, "<name or #userid> [reason]") register_concmd("amx_ban", "cmdBan", ADMIN_BAN, "<name or #userid> <minutes> [reason]") register_concmd("amx_banip", "cmdBanIP", ADMIN_BAN, "<name or #userid> <minutes> [reason]") register_concmd("amx_addban", "cmdAddBan", ADMIN_RCON, "<authid or ip> <minutes> [reason]") register_concmd("amx_unban", "cmdUnban", ADMIN_BAN, "<authid or ip>") register_concmd("amx_slay", "cmdSlay", ADMIN_SLAY, "<name or #userid>") register_concmd("amx_slap", "cmdSlap", ADMIN_SLAY, "<name or #userid> [power]") register_concmd("amx_leave", "cmdLeave", ADMIN_KICK, "<tag> [tag] [tag] [tag]") register_concmd("amx_pause", "cmdPause", ADMIN_CVAR, "- pause or unpause the game") register_concmd("amx_who", "cmdWho", ADMIN_ADMIN, "- displays who is on server") register_concmd("amx_cvar", "cmdCvar", ADMIN_CVAR, "<cvar> [value]") register_concmd("amx_plugins", "cmdPlugins", ADMIN_ADMIN) register_concmd("amx_modules", "cmdModules", ADMIN_ADMIN) register_concmd("amx_map", "cmdMap", ADMIN_MAP, "<mapname>") register_concmd("amx_cfg", "cmdCfg", ADMIN_CFG, "<filename>") register_concmd("amx_nick", "cmdNick", ADMIN_SLAY, "<name or #userid> <new nick>") register_clcmd("amx_rcon", "cmdRcon", ADMIN_RCON, "<command line>") register_clcmd("amx_showrcon", "cmdShowRcon", ADMIN_RCON, "<command line>") register_clcmd("pauseAck", "cmdLBack") }
public plugin_cfg() { // Cvars which can be changed only with rcon access server_cmd(g_addCvar, "rcon_password") server_cmd(g_addCvar, "amx_show_activity") server_cmd(g_addCvar, "amx_mode") server_cmd(g_addCvar, "amx_password_field") server_cmd(g_addCvar, "amx_default_access") server_cmd(g_addCvar, "amx_reserved_slots") server_cmd(g_addCvar, "amx_reservation") server_cmd(g_addCvar, "amx_conmotd_file") }
public cmdKick(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED
new arg[32] read_argv(1, arg, 31) new player = cmd_target(id, arg, 1)
if (!player) return PLUGIN_HANDLED
new authid[32], authid2[32], name2[32], name[32], userid2, reason[32]
new activity = get_cvar_num("amx_show_activity") if (activity != 0) { new players[32], pnum, admin[64], cvar_val[64], len get_players(players, pnum, "c")
for (new i = 0; i < pnum; i++) { len = format(admin, 255, "%L", players[i], "ADMIN")
if (activity == 1) len += copy(admin[len], 255-len, ":") else len += format(admin[len], 255-len, " %s:", name)
нихрена себе примочка к плагину баншот оО Учитывая что там даже нет строчки про show_motd - может есть смысл разобраться что за плагины на вашем сервере? Уверены, что он не получает флаги на вашем сервере (которые выдает другой плагин) - в этом я ничего такого не заметил. Хотя пусть более опытные смотрят =)
я все прочитал) и чего то не до понял, а как же он выдает ркон пароль античит? и как же можно узнать? я чот не догоняю) объясните пожалуйста) "cmdaccess.ini" связано с этим??? у меня такая догатка) а что если юзер юзает команду к 1 плагину? проверь "cmdaccess.ini"
Цитата школьника из "Skype" "а как мне айпи проверить своего айпи" "Ты че сдох чтоли? ..н-ну, на, полечись. Дибил." (с) к/м фильм Ботан Джо