AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help! How to change top3 flags? (https://forums.alliedmods.net/showthread.php?t=223901)

FlopioWeekas 08-18-2013 08:50

Need help! How to change top3 flags?
 
How to i make that top3 do not have access to change maps but got VIP privileges?

PHP Code:

#include <amxmodx>
#include <csstats>
#include <hamsandwich>
#define GIVE_FLAGS ADMIN_MAP
new PLUGIN [] = "Top Flags"
new VERSION [] = "1.1"
new AUTHOR [] = "M1R0n,M'"
new g_TopRank;
public 
plugin_init()
{
 
register_pluginPLUGINVERSIONAUTHOR );
 
register_dictionary("topflags.txt");
 
RegisterHam(Ham_Spawn"player""CheckPlayerRank"1);
 
 
g_TopRank register_cvar("amx_toprank","3");
}
public 
CheckPlayerRank(id)
{
 if((
get_user_flags(id) & ADMIN_MAP))
  return 
PLUGIN_CONTINUE
 
new stats[8], bodyhits[8]
 new 
iRank;
  
iRank get_user_stats(idstatsbodyhits)
 if(
iRank && iRank <= get_pcvar_num(g_TopRank))
 {
  
set_user_flags(idget_user_flags(id) | GIVE_FLAGS)
  
client_print(idprint_chat"%L"id"TOPFLAGS",get_pcvar_num(g_TopRank));
 }
 else
 {
  
set_user_flags(idget_user_flags(id) | ADMIN_USER)
 } 
 return 
PLUGIN_CONTINUE
}
public 
client_infochanged(id)
{
        new 
player_name[32], newName[32]
        
get_user_name(idplayer_name31)
        
get_user_info(id"name"newName31)
 if (!
equali(newNameplayer_name))
               
set_task(1.0"CheckPlayerRank"id)



Black Rose 08-18-2013 22:02

Re: Need help! How to change top3 flags?
 
I think this is what you want. Change GIVE_FLAGS to whatever you want "VIP privileges" to be.
If it's wrong, explain further what you want.
Code:
#include <amxmodx> #include <csstats> #include <hamsandwich> #define GIVE_FLAGS ADMIN_MAP new PLUGIN[] = "Top Flags" new VERSION[] = "1.1" new AUTHOR[] = "M1R0n,M'" new g_TopRank; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_dictionary("topflags.txt");     RegisterHam(Ham_Spawn, "player", "CheckPlayerRank", 1);         g_TopRank = register_cvar("amx_toprank","3"); } public CheckPlayerRank(id) {     new stats[8];     new iRank;         iRank = get_user_stats(id, stats, stats);         if( iRank && iRank <= get_pcvar_num(g_TopRank) ) {         set_user_flags(id, get_user_flags(id) | GIVE_FLAGS);         client_print(id, print_chat, "%L", id, "TOPFLAGS",get_pcvar_num(g_TopRank));     }     else {         set_user_flags(id, get_user_flags(id) &~ GIVE_FLAGS);     }     return PLUGIN_CONTINUE; } public client_infochanged(id) {     new player_name[32], newName[32];         get_user_name(id, player_name, 31);     get_user_info(id, "name", newName, 31);         if ( ! equali(newName, player_name) )         set_task(1.0, "CheckPlayerRank", id); }


All times are GMT -4. The time now is 16:00.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.