AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Player models won't change and they get bugged. (https://forums.alliedmods.net/showthread.php?t=258775)

wicked95 02-24-2015 06:17

Player models won't change and they get bugged.
 
I can't see the problem in the code. I made a custom jailbreak plugin with days, shop, games and other sh*t but the player model won't change. And not only does it not change but it gets bugged. Like arms are coming out of his mouth or they get a 3rd leg that is not moving xD.
The plugin got quite large. About 156KB .sma file.
I hope this is gona be enough:
PHP Code:

RegisterHam(Ham_Spawn"player""player_spawn"1); 

PHP Code:

precache_model("models/player/jbemodel/jbemodel.mdl"); 

PHP Code:

public player_spawn(id)
{
 if(
is_user_alive(id))
 {
  if(
bBlockSpawn && get_bit(g_BlockSpawnid))
  {
   
clear_bit(g_BlockSpawnid);
   
user_silentkill(id);
   return;
  }
  if(
task_exists(id+TASK_CAMOFLAGE))
   
remove_task(id+TASK_CAMOFLAGE);
  static 
CsTeams:iTeam;
  
set_bit(g_Aliveid);
  
iUserHealth[id] = get_user_health(id);
  
player_strip_weapons(id);
  
cs_reset_user_model(id);
  
set_user_info(id"model""jbemodel");
  
set_user_rendering(id);
  
iTeam cs_get_user_team(id);
  if(
iTeam == CS_TEAM_T)
  {
   if(
get_bit(g_FreeDayNextid) || bFreedayAll)
   {
    
freeday_set(0id);
    
clear_bit(g_FreeDayNextid);
   }
   else
   {
    
entity_set_int(idEV_INT_body2);
    
entity_set_int(idEV_INT_skinrandom_num(02));
   }
   
cs_set_user_armor(id0CS_ARMOR_NONE);
   if(
bFrozen)
   {
    
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN);
    
set_pev(idpev_maxspeed0.01);
   }
   
iPlayerKnife[id] = KN_HANDS;
   
ShowKnifeShopMenu(idg_menuPage[id] = 0);
   
set_user_gravity(id1.0);
  }
  else if(
iTeam == CS_TEAM_CT)
  {
   if(
iSimon == id)
    
entity_set_int(idEV_INT_body1);
   else
    
entity_set_int(idEV_INT_body3);
   
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
   
iPlayerKnife[id] = KN_ELECTROSHOCK;
  }
 }
 
CheckForLastPrisoner();



aron9forever 02-25-2015 03:57

Re: Player models won't change and they get bugged.
 
you'd better start working on that code's optimization, my whole jailbreak mode has 165kb lol

JusTGo 02-25-2015 06:39

Re: Player models won't change and they get bugged.
 
try useing cs_set_player_model instead of set_user_info.

wicked95 02-25-2015 18:59

Re: Player models won't change and they get bugged.
 
I don't get why I need to do that when the original JailBreak Extreme plugin works fine with set_user_info model but will try it.

Edit:
LOL that actualy worked xD
I still don't get why the 1st method wouldn't work tho?

HamletEagle 02-26-2015 10:24

Re: Player models won't change and they get bugged.
 
You should start by indenting your code and using SPACES(please!!!), it's a pain to check it as it is now. You can take a look at my Entities Resources Replacement, ClientUserInfochanged and SetClientKeyValue hooks are what you need to see.

If I'm right you need to specify full model path in set_user_info: models/player/jbemodel/jbemodel.mdl

wicked95 03-05-2015 11:46

Re: Player models won't change and they get bugged.
 
Solved.


All times are GMT -4. The time now is 18:05.

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