User
Pass
2FA
 
 

rules fara lag

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Fixed issues
Author Message421
Cosm1n1996

[Mentally Stable]



Status: Offline
(since 27-02-2014 21:12)
Joined: 26 Dec 2013
Posts: 121, Topics: 32
Location: Romania

Reputation: 49.4
Votes: 2

Post Posted: 09-02-2014, 16:50:18 | Translate post to: ... (Click for more languages)

am gasit pluginul asta pe net si e super fain.. dar face lag urias. cand apare atat.. daca se poate sa imi dea cineva pluginul dar o alta vers ceva fara lag sau unu ca asta fara lag...

Quote:
#include <amxmodx>
#include <amxmisc>

new base[] = "rules.txt"

new i, num, text[127], hudmsg[999]

public plugin_init()
{

register_plugin("reguli hud", "1.0", "easyy")

// register command

register_concmd("rules_show", "rules", ADMIN_KICK, "- show rules to everybody")
register_concmd("rules_enable", "r_enable", ADMIN_KICK, "- <1|0> set automessagin on/off")
register_cvar("rules_admin_only", "0")
register_cvar("rules_join", "1")
register_cvar("rules_join_timeout", "5")
register_cvar("rules_hudmessage_time", "10")
register_cvar("rules_interval", "120")
register_clcmd("say /reguli", "clientrules", ADMIN_ALL, "- show reguli")
register_clcmd("say /regulament", "clientrules", ADMIN_ALL, "- show regulament")
}

public plugin_cfg() {

if (!file_exists(base)) {
write_file(base, "; This is the public rules file, put your rules below")
write_file(base, "; Remember, max amount of characters is 439")
console_print(0, "%s file not found. creating new ...", base)
}

}

public client_authorized ( id ) {
// on join display rules

if (get_cvar_num("rules_join")) {
new tmp[1]
tmp[0] = id
set_task(1.0, "showrules",id,tmp,1)
console_print(0, "[user %d] client auth!", tmp[0])
}

return PLUGIN_HANDLED
}


public showrules (pid[]) {
new id = pid[0]

if ( get_user_team(id) != 1 && get_user_team(id) != 2 ) {
if (id) {
new tmp[1]
tmp[0] = id
set_task(2.0, "showrules",id,tmp,1) // not yet in server
console_print(0, "[user %d] wait for joining team ...", id)
}
return PLUGIN_HANDLED
}

new tmp[1]
tmp[0] = id

console_print(0, "[user %d] joined team : %d", id, get_user_team(id))
console_print(0, "[user %d] printing rules after %d seconds", id, get_cvar_num("rules_join_timeout"))

set_task(get_cvar_float("rules_join_timeout"), "printrules", id, tmp, 1) // not yet in server

return PLUGIN_HANDLED
}

public printrules(pid[])
{
new id = pid[0]
if (file_exists(base))
{

console_print(0, "[user] printing rules for user %d", id)

set_hudmessage ( 200, 150, 0, -1.0, 0.10, 2, 0.1, get_cvar_float("rules_hudmessage_time"), 0.05, 1.0, 1)
format(hudmsg, 439, "")

// read all the rules
for(i=0; read_file(base, i, text, 127, num); i++) {
if (num > 0 && text[0] != ';') {
// display with predefined delay
add(hudmsg,439,text)
add(hudmsg,439,"^n")
}
}

// show hudmessages
show_hudmessage(id, hudmsg)

}

return PLUGIN_HANDLED
}


public r_enable(id, level, cid)
{
if (!cmd_access(id, level, cid, 0)) { // NOT ADMIN
return PLUGIN_HANDLED
}

new arg[3]

read_argv(1, arg, 2)
new value = str_to_num(arg)

if (!isalnum(arg[0]))
value = -1

if (value == 0) {

if (task_exists(2)) // close task
remove_task(2)

console_print(id, "You have disabled automatic messages")
return PLUGIN_HANDLED

}
if (value == 1) {
// activate task, reload if already exist
if (task_exists(2)) {
change_task(2, get_cvar_float("rules_interval"))
} else {
set_task(get_cvar_float("rules_interval"), "rules", 2, "", 0, "b")
}
console_print(id, "You have enabled automatic messages")
return PLUGIN_HANDLED
}
if (task_exists(2)) {
console_print(id, "automessages is ON.")
} else {
console_print(id, "automessages is OFF.")
}
console_print(id, "rules_enable <1|0> (1 = ON, 0 = OFF)")
return PLUGIN_HANDLED

}

public clientrules(id, level, cid) {
new pID[1]
pID[0] = id

console_print(0,"[user %d]Print rules for me only",pID[0])
printrules(pID[0])
}

public rules(id, level, cid)
{
new pID[1]
pID[0] = id

if (!cmd_access(id, level, cid, 0)) { // NOT ADMIN
return PLUGIN_HANDLED
}

// read file to all users
pID[0] = 0
console_print(0,"[user %d]Print rules for all",id)
printrules(pID[0])

// Reset scheduled task after display
if (get_cvar_float("rules_interval") > 0) {
if (task_exists(2)) {
change_task(2, get_cvar_float("rules_interval"))
} else {
set_task(get_cvar_float("rules_interval"), "rules", 200, "", 0, "b")
}
}

return PLUGIN_HANDLED
}


_____________________________________________
Fac scripturi html dupa preferinte.Lasati PM cu datele
0 0
  
Back to top
View user's profile Send private message
Happy =]]

[I'm in your mind !]



Status: Offline
(since 02-05-2020 11:17)
Joined: 17 Mar 2012
Posts: 10538, Topics: 450
Location: In mintea ta !

Reputation: 553
Votes: 204

         
Post Posted: 09-02-2014, 19:53:46 | Translate post to: ... (Click for more languages)

Nu exista versiunea fara lag, cand iti apare ceva in plus pe ecran e si normal sa ingreuneze.





Pentru orice problema PM.
Nu ofer asistenta in privat.

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
Cosm1n1996

[Mentally Stable]



Status: Offline
(since 27-02-2014 21:12)
Joined: 26 Dec 2013
Posts: 121, Topics: 32
Location: Romania

Reputation: 49.4
Votes: 2

Post Posted: 09-02-2014, 19:59:10 | Translate post to: ... (Click for more languages)

dati t/c ms oricum...

_____________________________________________
Fac scripturi html dupa preferinte.Lasati PM cu datele
0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by Happy =]], 09 February 2014 18:01



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Fixed issues  


The time now is 19-07-2025, 18:58:59
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password