AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make the menu for all players! (https://forums.alliedmods.net/showthread.php?t=217277)

tanayraj 06-01-2013 01:01

How to make the menu for all players!
 
Hey! I have this plugin which is just for admins.I want to make the plugin open for all.Please help! Thanks!

PHP Code:


 
    
    
if (idplayers[0] = id; else get_players(playerscount"ch"); 
    { 
        for ( new 
0counti++ ) 
        { 
            if (
is_user_connected(players[i]) ) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEg_MsgSayText    _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 



~Ice*shOt 06-01-2013 01:55

Re: How to make the menu for all players!
 
PHP Code:

public PlayAnimation(id

    if (
get_user_flags(id) & ADMIN_IMMUNITY && is_user_alive(id)) 
    { 
        
menu_display(idg_animMenu
        return 
PLUGIN_HANDLED 
    

    else 
        
ChatColor(id"^4[JailBreak ExD]^1 You do not have access to this command"); 

    return 
PLUGIN_HANDLED 


>>>

PHP Code:

public PlayAnimation(id

    if (
is_user_alive(id)) 
    { 
        
menu_display(idg_animMenu
        return 
PLUGIN_HANDLED 
    
}
    return 
PLUGIN_HANDLED 



tanayraj 06-01-2013 01:57

Re: How to make the menu for all players!
 
Quote:

Originally Posted by ~Ice*shOt (Post 1962180)
PHP Code:

public PlayAnimation(id

    if (
get_user_flags(id) & ADMIN_IMMUNITY && is_user_alive(id)) 
    { 
        
menu_display(idg_animMenu
        return 
PLUGIN_HANDLED 
    

    else 
        
ChatColor(id"^4[JailBreak ExD]^1 You do not have access to this command"); 

    return 
PLUGIN_HANDLED 


>>>

PHP Code:

public PlayAnimation(id

    if (
is_user_alive(id)) 
    { 
        
menu_display(idg_animMenu
        return 
PLUGIN_HANDLED 
    
}
    return 
PLUGIN_HANDLED 



This is crashing the server! I have edited the post see the full code

Haskyutza 06-01-2013 01:58

Re: How to make the menu for all players!
 
You must delete just this thing
PHP Code:

if (get_user_flags(id) & ADMIN_IMMUNITY

so, this is your code

PHP Code:

public PlayAnimation(id

    if (
is_user_alive(id)) 
    
menu_display(idg_animMenu


public 
StartDance(idanim

    new 
seqDesc[SEQ_DESC
    
ArrayGetArray(g_iDataanimseqDesc
     
    new 
ent g_playerData[id][ENT_ANIM
    new 
modelEnt g_playerData[id][ENT_MODEL
    
set_pev(entpev_framerate1.0
    
set_pev(entpev_sequenceanim
    
set_pev(entpev_gaitsequenceanim
     
    new 
Float:origin[3], Float:mins[3
    
pev(idpev_originorigin
    
pev(idpev_minsmins
     
    
mins[0] = origin[0
    
mins[1] = origin[1
    
mins[2] += origin[2
    
set_pev(entpev_originmins
     
    
set_pev(modelEntpev_effects0
    new 
model[64
    
get_user_info(id"model"model63
    
format(model63"models/player/%s/%s.mdl"modelmodel
    
engfunc(EngFunc_SetModelmodelEntmodel
     
    
set_pev(modelEntpev_bodypev(idpev_body)) 
    
set_pev(modelEntpev_skinpev(idpev_skin)) 
     
    
set_pev(entpev_controller_0128
    
set_pev(entpev_controller_1128
     
    
pev(idpev_anglesmins
    
mins[0] = 0.0 
    set_pev
(entpev_anglesmins
    
set_pev(entpev_v_anglemins
     
    
engfunc(EngFunc_SetViewidg_playerData[id][ENT_CAM]) 
    
g_playerData[id][ANIM_PLAYING] = 
     
    set_pev
(idpev_effectsEF_NODRAW
     


public 
StopDance(id

    
set_pev(g_playerData[id][ENT_MODEL], pev_effectsEF_NODRAW
    
g_playerData[id][ANIM_PLAYING] = 
    set_pev
(idpev_effects0
     
    
engfunc(EngFunc_SetViewidid


public 
Dance_MenuHandler(idmenuitem

    if(
item == MENU_EXIT
        return 
PLUGIN_HANDLED 
     
    
new access[32
    
get_pcvar_string(g_cvarAccessFlagaccess31
     
    if (!(
pev(idpev_flags) & FL_ONGROUND)) 
    { 
        
ChatColor(id"^4[Jailbreak ExD] ^1You have to be ^3 in the countryi ^1you're using this option!!")   
        return 
PLUGIN_HANDLED 
    

     
    
StartDance(iditem
     
    
menu_display(idg_animMenufloatround(item/7.0floatround_floor)) 
     
    return 
PLUGIN_HANDLED 



tanayraj 06-01-2013 02:07

Re: How to make the menu for all players!
 
The menu opened but when i tried a move the server crashed!

hornet 06-01-2013 06:04

Re: How to make the menu for all players!
 
Quote:

Originally Posted by tanayraj (Post 1962185)
The menu opened but when i tried a move the server crashed!

What are you trying to do? Why have you removed code from your post?


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

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