Raised This Month: $ Target: $400
 0% 

Player models won't change and they get bugged.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicked95
Member
Join Date: Dec 2012
Old 02-24-2015 , 06:17   Player models won't change and they get bugged.
Reply With Quote #1

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();


Last edited by wicked95; 02-24-2015 at 06:25.
wicked95 is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 02-25-2015 , 03:57   Re: Player models won't change and they get bugged.
Reply With Quote #2

you'd better start working on that code's optimization, my whole jailbreak mode has 165kb lol
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 02-25-2015 , 06:39   Re: Player models won't change and they get bugged.
Reply With Quote #3

try useing cs_set_player_model instead of set_user_info.
__________________

Last edited by JusTGo; 02-25-2015 at 06:40.
JusTGo is offline
wicked95
Member
Join Date: Dec 2012
Old 02-25-2015 , 18:59   Re: Player models won't change and they get bugged.
Reply With Quote #4

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?

Last edited by wicked95; 02-25-2015 at 19:04.
wicked95 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-26-2015 , 10:24   Re: Player models won't change and they get bugged.
Reply With Quote #5

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
__________________

Last edited by HamletEagle; 02-26-2015 at 10:27.
HamletEagle is offline
wicked95
Member
Join Date: Dec 2012
Old 03-05-2015 , 11:46   Re: Player models won't change and they get bugged.
Reply With Quote #6

Solved.
wicked95 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 18:05.


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