Raised This Month: $51 Target: $400
 12% 

Player menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
remix.allstarz
Member
Join Date: Dec 2013
Old 03-16-2023 , 15:51   Player menu
Reply With Quote #1

Hello,

I have the following problem

Naruto is my default model on the server

I have a skin menu where you can choose other models but as soon as the round is over you get naruto back why is that?

watch screen
Attached Thumbnails
Click image for larger version

Name:	20230316204312_1.jpg
Views:	65
Size:	94.2 KB
ID:	199946   Click image for larger version

Name:	20230316204317_1.jpg
Views:	57
Size:	94.1 KB
ID:	199947  
Attached Files
File Type: sma Get Plugin or Get Source (skins_menu.sma - 62 views - 3.5 KB)

Last edited by remix.allstarz; 03-16-2023 at 15:54.
remix.allstarz is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 03-16-2023 , 17:19   Re: Player menu
Reply With Quote #2

Is your default model chosen by yourself?
Or is it applied automatically when you enter the server?
__________________
amirwolf is offline
remix.allstarz
Member
Join Date: Dec 2013
Old 03-17-2023 , 12:20   Re: Player menu
Reply With Quote #3

I have 2 plugins Playermodels and skin menu

playermodels change default to naruto
remix.allstarz is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 03-17-2023 , 12:51   Re: Player menu
Reply With Quote #4

So you know the answer to the problems yourself
Another plugin is involved in changing the model
__________________
amirwolf is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 03-18-2023 , 21:33   Re: Player menu
Reply With Quote #5

As amir said, the plugin setting it back to the naruto skin is setting the model on spawn / round start.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
remix.allstarz
Member
Join Date: Dec 2013
Old 03-19-2023 , 05:39   Re: Player menu
Reply With Quote #6

Yes
remix.allstarz is offline
remix.allstarz
Member
Join Date: Dec 2013
Old 03-19-2023 , 14:13   Re: Player menu
Reply With Quote #7

So you automatically have a skin when you come in and as soon as you type /skins and you choose another one, nothing happens
use playermodels once and skinmenu once
remix.allstarz is offline
Dexon
Member
Join Date: Aug 2019
Old 03-19-2023 , 17:06   Re: Player menu
Reply With Quote #8

There is literally no save, so there is no way for the plugin to remember the desired skin.
I made a few changes as ugly as your code is, so you can see the difference and the required calls.
Also, Im not sure if the model can be set instantly or only on playerspawn, but I added that anyway.
PHP Code:
/* Plugin generated by AMXX-Studio*/
//  Be careful! I just recomend this plugins for game mods like zombie because
// if player changes team the model still on him and you cant know if CT or TT
//  Remember that you need put your models with right name on right folder :D

#include < amxmodx >
#include < cstrike >
#include <hamsandwich>

#define PLUGIN "Skins Menu"
#define VERSION "1.0"
#define AUTHOR "Jhob94"

new g_iSkin[33];

public 
plugin_precache()
    {
        
precache_model("models/player/Naruto/Naruto.mdl");
        
precache_model("models/player/Sasuke/Sasuke.mdl");
        
precache_model("models/player/Gaara/Gaara.mdl");
        
precache_model("models/player/Kisame/Kisame.mdl");
        
precache_model("models/player/Terminator/Terminator.mdl")
        
precache_model("models/player/MyIchigo/MyIchigo.mdl")
        
precache_model("models/player/Goku/Goku.mdl")
    }

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"say /skins",     "Skins_Menu" );

    
RegisterHam(Ham_Spawn"player""fwPlayerSpawn"1)
    }
    
public 
fwPlayerSpawn(id){
    if(!
is_user_alive(id))
        return;

  switch(
g_iSkin[id])
      {
         case 
2:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Sasuke")
            }
        }
         case 
3:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Gaara")
            }
        }
         case 
4:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Kisame")
            }
        }
    case 
5:
         {
         if(!(
get_user_flags(id) & ADMIN_KICK))
        {
        }
         else
        {
            
cs_set_user_model(id"Terminator")
        }
         }
    case 
6:
         {
         if(!(
get_user_flags(id) & ADMIN_VOTE))
        {       
        }
         else
        {
            
cs_set_user_model(id"MyIchigo")
        }
         }
    case 
7:
         {
         if(!(
get_user_flags(id) & ADMIN_KICK))
        {      
        }
         else
        {
            
cs_set_user_model(id"Goku")
        }
         }
        default:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Naruto")
                
            }
        }
      }
}

public 
Skins_Menuid 

    new 
menu menu_create("Select Your Skin""skin_menu"
    
menu_additem(menu"Naruto""1"); 
    
menu_additem(menu"Sasuke""2"); 
    
menu_additem(menu"Gaara""3");
    
menu_additem(menu"Kisame""4");
    
menu_additem(menu"Terminator""5"0);
    
menu_additem(menu"MyIchigo""6"0);
    
menu_additem(menu"Goku""7"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL );  
    
menu_displayidmenu); 


public 
skin_menu(idmenuitem)
{
   if (
item == MENU_EXIT)
   {
      
menu_destroy(menu)
      return 
PLUGIN_HANDLED;
   }
   new 
info[3]
   new 
accesscallback
   menu_item_getinfo
(menuitemaccessinfo2__callback)
   
   if(
is_user_alive(id))
   {   
      new 
key str_to_num(info)


      switch(
key)
      {
         case 
1:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Naruto")
                
g_iSkin[id] = key
            
}
        }
         case 
2:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Sasuke")
                
g_iSkin[id] = key
            
}
        }
         case 
3:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Gaara")
                
g_iSkin[id] = key
            
}
        }
         case 
4:
         {
            if(
cs_get_user_team(id) == CS_TEAM_CT)
            {
                
cs_set_user_model(id"Kisame")
                
g_iSkin[id] = key
            
}
        }
    case 
5:
         {
         if(!(
get_user_flags(id) & ADMIN_KICK))
        {
            
client_print(idprint_chat"[SkinInfo] Only ADMINs can use this skin, to get access please type /vipinfo and join the discord.")
            return 
PLUGIN_HANDLED
        
}
         else
        {
            
cs_set_user_model(id"Terminator")
            
g_iSkin[id] = key
        
}
         }
    case 
6:
         {
         if(!(
get_user_flags(id) & ADMIN_VOTE))
        {
            
client_print(idprint_chat"[SkinInfo] Only ADMINs and VIPs can use this skin, to get access please type /vipinfo and join the discord.")
            return 
PLUGIN_HANDLED            
        
}
         else
        {
            
cs_set_user_model(id"MyIchigo")
            
g_iSkin[id] = key
        
}
         }
    case 
7:
         {
         if(!(
get_user_flags(id) & ADMIN_KICK))
        {
            
client_print(idprint_chat"[SkinInfo] Only ADMINs can use this skin, to get access please type /vipinfo and join the discord.")
            return 
PLUGIN_HANDLED            
        
}
         else
        {
            
cs_set_user_model(id"Goku")
            
g_iSkin[id] = key
        
}
         }
}
}
    return 
PLUGIN_CONTINUE;

If you wish, tomorrow I could optimize it, and make it max 50 line of code so i could show you some other and also better ways.
__________________
[ExTasY] Furien Hero [CRAFT SYSTEM]
213.181.206.21:27140

[ExTasY] Zombie Mutation [ZOMBIE NPC]
213.181.206.28:27057

Join now!

Video: https://www.youtube.com/watch?v=fNahCsS8DOU&t=328s
DC: https://discord.gg/swARTUZCZ4

Creating private plugins, reference above.

Last edited by Dexon; 03-19-2023 at 17:20.
Dexon is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:11.


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