Page 4 of 5
Re: Player Models
Posted: 2016 Jan 15 00:23
by hleV
Nu pakeičiau pagal tai ko tau reikia, turėtų veikt.
Code: Select all
#include <amxmodx>#include <pmodel> new const T_Model[] = "arsteam_te"new const CT_Model[] = "arsteam_ct" public plugin_precache(){ PrecachePlayerModel(T_Model) PrecachePlayerModel(CT_Model)} public plugin_init(){ register_event("TeamInfo", "OnTeamInfo", "a"); // Uzregistruojam ivyki, kai zaidėjo komanda pasikeicia. UsePlayerModels(); // Sita butina panaudot, kitaip SetPlayerModel() neveiks.} public client_disconnected(id){ SetPlayerModel(id)} public OnTeamInfo(){ new client = read_data(1); // Gaunam zaidėjo ID iš ivykio. // Imanoma, kad jis atsijunge, tad reikia patikrinti. if (!is_user_connected(client)) return; if (!is_user_steam(client)) return; // Gaunam nauja zaidejo komanda is ivykio. new team[2]; read_data(2, team, charsmax(team)); switch (team[0]) // Tikrinam pirma komandos raide. { case 'T': SetPlayerModel(client, T_Model); // Jei T, nustatom CT skin'a. case 'C': SetPlayerModel(client, CT_Model); // Jei CT, nustatom T skin'a. }} stock bool:is_user_steam(id){ // Author Sh0oter static dp_pointer; if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider"))) { server_cmd("dp_clientinfo %d", id); server_exec(); return (get_pcvar_num(dp_pointer) == 2) ? true : false ; } return false;}
Re: Player Models
Posted: 2019 Feb 01 20:20
by laimiukas3
hleV, ponas o kaip turetu atrodyti jaigu naudojama sub model na tiksliau ne sub model o skin
cia kaip suprantu sub modeliui
set_pev(client, pev_body, 1))
o cia skin
set_pev(client, pev_skin, 1))
o kaip tai turetu artrodyti tavo auksciau pateiktam kode pvz jaigu priskirti ADMIN_LEVEL_H skin 1 ADMIN_BAN skin 2 ir tarkim is_user_steam skin 3
Re: Player Models
Posted: 2019 Feb 01 22:01
by hleV
Nežinau kada ta skin reikšmė resetinasi, bet pabandyk taip:
Code: Select all
switch (team[0]) // Tikrinam pirma komandos raide. { case 'T': SetPlayerModel(client, T_Model); // Jei T, nustatom CT skin'a. case 'C': SetPlayerModel(client, CT_Model); // Jei CT, nustatom T skin'a. }
→
Code: Select all
CustomSetPlayerModel(client, team[0]);
Ir apsirašyk custom funkciją kur apdorosi visas sąlygas:
Code: Select all
CustomSetPlayerModel(client, team){ new flags = get_user_flags(client); switch (team) { case 'T': { SetPlayerModel(client, T_Model); if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 2); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 1); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 3); } case 'C': { SetPlayerModel(client, CT_Model); if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 2); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 1); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 3); } }}
Re: Player Models
Posted: 2019 Feb 01 23:45
by laimiukas3
hm kazka turbut ne taip darau
Code: Select all
#include <amxmodx>#include <engine>//#include <reapi>#include <pmodel> new const T_Model[] = "aa_players_tt_v4"new const CT_Model[] = "aa_players_ct_v4" public plugin_precache(){ PrecachePlayerModel(T_Model) PrecachePlayerModel(CT_Model)} public plugin_init(){ register_event("TeamInfo", "OnTeamInfo", "a"); // Uzregistruojam ivyki, kai zaidëjo komanda pasikeicia. UsePlayerModels(); // Sita butina panaudot, kitaip SetPlayerModel() neveiks.} public client_disconnected(id){ SetPlayerModel(id)} public OnTeamInfo(){ new client = read_data(1); // Gaunam zaidëjo ID ið ivykio. // Imanoma, kad jis atsijunge, tad reikia patikrinti. if (!is_user_connected(client)) return; // Gaunam nauja zaidejo komanda is ivykio. new team[2]; read_data(2, team, charsmax(team)); CustomSetPlayerModel(client, team[0]);} CustomSetPlayerModel(client, team){ new flags = get_user_flags(client); switch (team) { case 'T': { SetPlayerModel(client, T_Model); if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 3); // ADMIN else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 2); // VIP else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 1); // STEAM } case 'C': { SetPlayerModel(client, CT_Model); if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 3); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 2); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 1); } }} stock bool:is_user_steam(id){ // Author Sh0oter static dp_pointer; if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider"))) { server_cmd("dp_clientinfo %d", id); server_exec(); return (get_pcvar_num(dp_pointer) == 2) ? true : false ; } return false;}
parasti zaidejai kurie neturi jokio flago gauna steam uzrasu skin kuris tam modeli yra skin pirmas steam klijentai zaidejai gauna VIP skin kuris tam modeli yra skin antras ir galiause net turintis bti flagus reiskia neturintis ADMIN_BAN flago gauna 3 skina
Re: Player Models
Posted: 2019 Feb 02 15:15
by hleV
Nu čia greitas pataisymas, bet nežinau ar pakeitus modelį skin reikšmė resetinasi, nes šiuo atveju pirma nustato skin, tada model.
Code: Select all
CustomSetPlayerModel(client, team){ new flags = get_user_flags(client); switch (team) { case 'T': { if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 2); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 1); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 3); else return; SetPlayerModel(client, T_Model); } case 'C': { if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 2); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 1); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 3); else return; SetPlayerModel(client, CT_Model); } }}
Jei neveiks tai tiesiog
if
uose atsidaryk blokus
{ }
ir viduj nustatyk modelį ir tada skiną.
Re: Player Models
Posted: 2019 Feb 06 00:02
by laimiukas3
HleV, po mirties nesvarbu kuris modelis buvo priskirtas zaidejui ji pakeiciamas i 1 siuo atveju steam ar imanoma padaryti kad mirus butu resetinamas skinas i default originalu zaidejo skina kuri pasirenki jungdamais i server
Re: Player Models
Posted: 2019 Feb 08 00:16
by hleV
Užhookink žaidėjo mirtį ir iššauk SetPlayerModel(client)
.
Re: Player Models
Posted: 2019 Feb 13 18:12
by laimiukas3
bleha man nesigauna

Re: Player Models
Posted: 2019 Feb 13 22:42
by hleV
Code: Select all
#include <hamsandwich> public plugin_init(){ // Bandom pre hook RegisterHam(Ham_Spawn, "player", "@OnPlayerPreSpawn", false);} @OnPlayerPreSpawn(client){ SetPlayerModel(client);}
Re: Player Models
Posted: 2019 Feb 14 08:57
by laimiukas3
hm su hamsandwich neveikia vistiek mirus uzdeda skin 1
o su reapi
RegisterHookChain(RG_CBasePlayer_Killed, "@OnPlayerPreSpawn", 1);
veikia
Code: Select all
#include <amxmodx>#include <engine>#include <pmodel>#include <hamsandwich>#include <reapi> new const T_Model[] = "T_NEW"new const CT_Model[] = "CT_NEW" public plugin_precache(){ PrecachePlayerModel(T_Model) PrecachePlayerModel(CT_Model)} public plugin_init(){ register_event("TeamInfo", "OnTeamInfo", "a"); // Uzregistruojam ivyki, kai zaid?jo komanda pasikeicia. UsePlayerModels(); // Sita butina panaudot, kitaip SetPlayerModel() neveiks. RegisterHam(Ham_Spawn, "player", "@OnPlayerPreSpawn", false); //neveikia //RegisterHookChain(RG_CBasePlayer_Killed, "@OnPlayerPreSpawn", 1); //veikia //RegisterHookChain(RG_CBasePlayer_Spawn, "@OnPlayerPreSpawn", false); //neveikia} @OnPlayerPreSpawn(client){ SetPlayerModel(client);} public client_disconnected(id){ SetPlayerModel(id)} public OnTeamInfo(){ new client = read_data(1); // Gaunam zaid?jo ID i? ivykio. // Imanoma, kad jis atsijunge, tad reikia patikrinti. if (!is_user_connected(client)) return; // Gaunam nauja zaidejo komanda is ivykio. new team[2]; read_data(2, team, charsmax(team)); CustomSetPlayerModel(client, team[0]);} CustomSetPlayerModel(client, team){new flags = get_user_flags(client); switch (team){ case 'T': { if (flags & ADMIN_IMMUNITY) entity_set_int(client, EV_INT_skin, 3); else if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 2); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 1); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 0); else return; SetPlayerModel(client, T_Model); } case 'C': { if (flags & ADMIN_IMMUNITY) entity_set_int(client, EV_INT_skin, 3); else if (flags & ADMIN_BAN) entity_set_int(client, EV_INT_skin, 2); else if (flags & ADMIN_LEVEL_H) entity_set_int(client, EV_INT_skin, 1); else if (is_user_steam(client)) entity_set_int(client, EV_INT_skin, 0); else return; SetPlayerModel(client, CT_Model); } }} /* nereikalingas nes naudojamas reapistock bool:is_user_steam(id){ // Author Sh0oter static dp_pointer; if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider"))) { server_cmd("dp_clientinfo %d", id); server_exec(); return (get_pcvar_num(dp_pointer) == 2) ? true : false ; } return false;}*/[code]
[/code]