Maybe a better way to check for flags..
Maybe a better way to check for flags..
(For example) this is very simple code that give players with admin flag hp.. Code:
#include <amxmodx> But the question is, is it posible to make vip plugin that check for flags only in 2 cases when player connects to server , and when players change nick (because most admin flags and vips are on the nick) and then executes plugin ...The reason i ask is it posible because in csdm players spawn all the time and each time someone spawns plugins asks if he hase flags , and its very inefficient way for checing the flags... This is the part that kills all vip plugins.. Code:
public player_spawn(id) |
Re: Maybe a better way to check for flags..
You should have posted in the scripting help section.
Anyway, you can use client_authorized() and use a boolean variable to store if the player has the required flag. Use client_infochanged() to check for name change. |
Re: Maybe a better way to check for flags..
Quote:
Anyways i am pretty sure this is what connoissuer is saying (which you could have found if you just searched titles for get_user_flags..): https://forums.alliedmods.net/showpo...86&postcount=4 |
Re: Maybe a better way to check for flags..
Quote:
|
Re: Maybe a better way to check for flags..
I simply wanted to know is it posible to replace this line
Code:
public player_spawn(id) if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_B)Code:
get_user_flags(id) & ADMIN_LEVEL_BIt wold be match better if plugin would only ask 2 times for flags , first time when players connects to server , and remebers that this player hase flags and executes rest of plugin and dont ask evry spawn for flags .. And second time should be if players change nick , then plugin would ask agien if he hase flags , if he hase remeber and executes rest of plugin.. All i want to do is reduce draw calls and it would reduce ping , lag , and server cpu usege ... |
Re: Maybe a better way to check for flags..
Quote:
Quote:
Code:
|
Re: Maybe a better way to check for flags..
@swapped plugin doesn`t work(doesnt give hp)... Basically all i want to know IS IT POSIBLE to make same plugin , but with out checking every spawn each player for flags...I want something that will only check once and then every next spawn plugin will remeber that this Player hase flags ,and if this player hase not flags plugin will remember that , and will not check them agien ....I dont know how to explain this even simpler...
|
Re: Maybe a better way to check for flags..
Quote:
maybe if u try this ... Code:
|
Re: Maybe a better way to check for flags..
Code:
|
Re: Maybe a better way to check for flags..
Quote:
|
| All times are GMT -4. The time now is 18:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.