AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Req] set Player model (https://forums.alliedmods.net/showthread.php?t=260252)

Zaidbt 03-22-2015 08:12

[Req] set Player model
 
Hey , i built this menu ,
PHP Code:

#include <amxmodx>  
#include <fun>  
#include <cstrike> 

public plugin_init() 
 { 
     
register_clcmd"say /class","Classmenu" );  
 }  
 public 
Classmenuid 
 { 
     
    new 
menu menu_create"Class menu""menu_handler" ); 
     
    
menu_additemmenu"\\w Sasuke"""); 
    
menu_additemmenu"\\w Naruto"""); 
    
menu_additemmenu"\\y Neji"""ADMIN_ADMIN ); 
    

    
menu_setpropmenuMPROP_EXITMEXIT_ALL );      
    
menu_displayidmenu); 
      
 } 

 public 
menu_handleridmenuitem 
 { 

    switch( 
item 
    { 
        case 
0
        { 
            
client_printidprint_chat"You Are now Sasuke xD" ); 
            
set_user_maxspeedid get_user_maxspeedid ) + 700.0 ); 
            
set_user_health(idget_user_healthid ) + 300); 
            
give_item(id"weapon_hegrenade")
            
give_item(id"Weapon_smokegrenade")
            
cs_set_user_bpammo(idCSW_HEGRENADE10)
            
cs_set_user_bpammo(idCSW_SMOKEGRENADE10)  

            
menu_destroymenu ); 
            return 
PLUGIN_HANDLED
        } 
        case 
1
        { 
            
client_printidprint_chat" You are now Naruto" ); 
            
set_user_maxspeedid get_user_maxspeedid ) + 500.0 ); 
            
set_user_health(idget_user_healthid ) + 350); 
        } 
        case 
2
        { 
            
client_printidprint_chat"You have selected Neji" ); 
        } 
        case 
MENU_EXIT
        { 
            
client_printidprint_chat"You exited the menu... " ); 
        } 
    } 

     
    
menu_destroymenu ); 
    return 
PLUGIN_HANDLED
 } 

I Want to display it , once the player is connected , and allow to open it one time in round ? i was told that i should use some natives Like
PHP Code:

 client_putinserver id 

, but i dont know how to , but also i need the code to change the player model to models/player/x when He choose 1 for exemple.. can any one help pls ? Ty

GhostMan 03-22-2015 15:55

Re: [Req] set Player model
 
Here is example how to call your menu 10 sec after player connects to server.

PHP Code:

#define TASK_CALL 6312

public client_putinserver(id)
{
    
set_task(10.0"call_menu"id+TASK_CALL)
}

public 
call_menu(id)
{
    new 
pid id TASK_CALL
    
    
if(is_user_alive(pid)
        
Classmenu(pid)



Zaidbt 03-22-2015 19:44

Re: [Req] set Player model
 
Ty Bro :)


All times are GMT -4. The time now is 15:33.

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