This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
really
Junior Member
Join Date: Sep 2012
Old 11-22-2012 , 09:14   Models
Reply With Quote #1

Hello, I need help with changing models on csgo server... here is the code

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <colors>

new String:T_1_MODEL[PLATFORM_MAX_PATH 1];

//new String:CT_1_MODEL[PLATFORM_MAX_PATH + 1];



public Plugin:myinfo =
{
    
name "Vip_Models",
    
author "Popoklopsi//Really",
    
version "1.1",
    
description "Give VIP's VIP Models",
    
url "http://games.warshare.net/"
}


public 
OnPluginStart()
{    
    
HookEvent("player_spawn"eventPlayerSpawn);
    
    
ModelDownloads();
    
}

public 
OnConfigsExecuted()
{
    new 
Handle:model_settings CreateKeyValues("ModelSettings");
    
    
FileToKeyValues(model_settings"cfg/ModelSettings.txt");
    
    
KvGetString(model_settings"T_1_MODEL"T_1_MODELsizeof(T_1_MODEL));

    
//KvGetString(model_settings, "CT_1_MODEL", CT_1_MODEL, sizeof(CT_1_MODEL));
    
    
    
    
    
if (!StrEqual(T_1_MODEL"") && !StrEqual(T_1_MODEL"0") && !StrEqual(T_1_MODEL" ")) PrecacheModel(T_1_MODELtrue);
    
    
//if (!StrEqual(CT_1_MODEL, "") && !StrEqual(CT_1_MODEL, "0") && !StrEqual(CT_1_MODEL, " ")) PrecacheModel(CT_1_MODEL, true);
    
    
CloseHandle(model_settings);
}


public 
ModelDownloads()
{
    new 
Handle:downloadfile OpenFile("cfg/ModelDownloads.txt""rb");
    
    while (!
IsEndOfFile(downloadfile))
    {
        new 
String:filecontent[PLATFORM_MAX_PATH 10];
        
        
ReadFileLine(downloadfilefilecontentsizeof(filecontent));
        
ReplaceString(filecontentsizeof(filecontent), " """);
        
ReplaceString(filecontentsizeof(filecontent), "\n""");
        
ReplaceString(filecontentsizeof(filecontent), "\t""");
        
ReplaceString(filecontentsizeof(filecontent), "\r""");
        
        if (!
StrEqual(filecontent"")) AddFileToDownloadsTable(filecontent);
    }
    
    
CloseHandle(downloadfile);
}


public 
eventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if(
CheckCommandAccess(client"" ,ADMFLAG_BANtrue))
    {
        
/*
        if(GetClientTeam(client) == 3)
        {
            SetEntityModel(client, CT_1_MODEL);    
        }*/
        
if(GetClientTeam(client) == 2)
        {
            
SetEntityModel(clientT_1_MODEL);    
        }
    }

Files are downloading... but when round started u dont have model of VIP but u have "ERROR" word.
Look this link http://cloud.steampowered.com/ugc/92...E5D4B164E621F/ can someone help me? what i done wrong?
really is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 11-22-2012 , 12:28   Re: Models
Reply With Quote #2

Toss a ...
PHP Code:
LogToGame("[VIPs] Client %i's new model file is \"%s\""GetClientUserId(client), T_1_MODEL
... in right before the SetEntityModel(...) function to see what model file is actually being set.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 11-22-2012 at 12:31.
paegus is offline
really
Junior Member
Join Date: Sep 2012
Old 11-23-2012 , 14:37   Re: Models
Reply With Quote #3

so sth like this?

PHP Code:
public eventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if(
CheckCommandAccess(client"" ,ADMFLAG_CUSTOM5true))
    {
        
/*
        if(GetClientTeam(client) == 3)
        {
            SetEntityModel(client, CT_1_MODEL);    
        }*/
        
if(GetClientTeam(client) == 2)
        {
            
LogToGame("[VIP] Client %i's new model file is \"%s\""GetClientUserId(client), T_1_MODEL)  
            
SetEntityModel(clientT_1_MODEL);    
        }
    }

really is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 11-23-2012 , 15:07  
Reply With Quote #4

Yes

What does the server say on roundstart?
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod

Last edited by paegus; 11-23-2012 at 15:08.
paegus is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 11-23-2012 , 15:17   Re: Models
Reply With Quote #5

try another model and make sure it is a valid SERVERSIDEMODEL , also check if you have all modelfiles on game- and webserver
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
really
Junior Member
Join Date: Sep 2012
Old 11-27-2012 , 12:07   Re: Models
Reply With Quote #6

soooo....
PHP Code:

public eventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if(
CheckCommandAccess(client"" ,ADMFLAG_CUSTOM5true))
    {
        
/*
        if(GetClientTeam(client) == 3)
        {
            SetEntityModel(client, CT_1_MODEL);    
        }*/
        
if(GetClientTeam(client) == 2)
        {
            
LogToGame("[VIP] Client %i's new model file is \"%s\""GetClientUserId(client), T_1_MODEL)   
            
SetEntityModel(clientT_1_MODEL);    
        }
    }


and on round spawn was in console that.


CCSPlayer in solid list (not solid)
CCSPlayer in solid list (not solid)
CCSPlayer in solid list (not solid)
CCSPlayer in solid list (not solid)
CCSPlayer in solid list (not solid)



Bad ragdoll for player/kirby/admin/admin_phoenix.mdl

Please help!!!

and i tried this model http://gamebanana.com/csgo/skins/120603

so i edited it and... error is this Bad ragdoll for player/kirby/admin/admin_phoenix.mdl and we have all materials on server on this way


materials/models/warshare/tm_phoenix_upperbody_variantc.vmt
materials/models/warshare/tm_phoenix_shared.vmt
materials/models/warshare/tm_phoenix_lowerbody_variantc.vmt
materials/models/warshare/tm_phoenix_head_variantC.vmt
materials/models/warshare/admin_phoenix_upperbody_variantc.vtf
materials/models/warshare/admin_phoenix_lowerbody_variantc.vtf
materials/models/warshare/admin_phoenix_head_variantb.vtf
models/warshare/admin_phoenix.dx90.vtx
models/warshare/admin_phoenix.vvd
models/warshare/admin_phoenix.mdl

and models setting are like this
"T_1_MODEL" "models/warshare/admin_phoenix.mdl"

sooo.. i think that models/warshare/admin_phoenix.mdl cant precache other files for model becouse it must be in "player/kirby/admin/admin_phoenix.mdl"

thats reason why its not working?

Last edited by really; 11-27-2012 at 12:42. Reason: edited LogToGame
really is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-27-2012 , 22:07   Re: Models
Reply With Quote #7

models/player/kirby/admin/admin_phoenix.mdl
Mitchell is offline
really
Junior Member
Join Date: Sep 2012
Old 11-28-2012 , 09:15   Re: Models
Reply With Quote #8

soooo.... here i put this into Download config

materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_upperbody_variantc.vmt
materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_shared.vmt
materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_lowerbody_variantc.vmt
materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_head_variantC.vmt
materials/models/player/kirby/admin/admin_phoenix/admin_phoenix_upperbody_variantc.vtf
materials/models/player/kirby/admin/admin_phoenix/admin_phoenix_lowerbody_variantc.vtf
materials/models/player/kirby/admin/admin_phoenix/admin_phoenix_head_variantb.vtf
models/player/kirby/admin/admin_phoenix.dx90.vtx
models/player/kirby/admin/admin_phoenix.vvd
models/player/kirby/admin/admin_phoenix.mdl

and effect is this....

my screenshot : http://cloud-2.steampowered.com/ugc/...9EFA2AA723567/

and screenshot of my friend: http://cloud.steampowered.com/ugc/92...E5D4B164E621F/


so... i played next 3 maps and.... my fried had downloaded models from server but it downloaded when next map stated so... problem is that i think... that user who connected at 9 nounds left or more or low cant download the models???? sorry for bad english....

here is the code:

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <colors>

new String:T_1_MODEL[PLATFORM_MAX_PATH 1];

//new String:CT_1_MODEL[PLATFORM_MAX_PATH + 1];



public Plugin:myinfo =
{
    
name "Vip_Models",
    
author "Popoklopsi//Really",
    
version "1.1",
    
description "Give VIP's VIP Models",
    
url "http://games.warshare.net/"
}


public 
OnPluginStart()
{    
    
HookEvent("player_spawn"eventPlayerSpawn);
    
    
ModelDownloads();
    
}

public 
OnConfigsExecuted()
{
    new 
Handle:model_settings CreateKeyValues("ModelSettings");
    
    
FileToKeyValues(model_settings"cfg/ModelSettings.txt");
    
    
KvGetString(model_settings"T_1_MODEL"T_1_MODELsizeof(T_1_MODEL));

    
//KvGetString(model_settings, "CT_1_MODEL", CT_1_MODEL, sizeof(CT_1_MODEL));
    
    
    
    
    
if (!StrEqual(T_1_MODEL"") && !StrEqual(T_1_MODEL"0") && !StrEqual(T_1_MODEL" ")) PrecacheModel(T_1_MODELtrue);
    
    
//if (!StrEqual(CT_1_MODEL, "") && !StrEqual(CT_1_MODEL, "0") && !StrEqual(CT_1_MODEL, " ")) PrecacheModel(CT_1_MODEL, true);
    
    
CloseHandle(model_settings);
}


public 
ModelDownloads()
{
    new 
Handle:downloadfile OpenFile("cfg/ModelDownloads.txt""rb");
    
    while (!
IsEndOfFile(downloadfile))
    {
        new 
String:filecontent[PLATFORM_MAX_PATH 10];
        
        
ReadFileLine(downloadfilefilecontentsizeof(filecontent));
        
ReplaceString(filecontentsizeof(filecontent), " """);
        
ReplaceString(filecontentsizeof(filecontent), "\n""");
        
ReplaceString(filecontentsizeof(filecontent), "\t""");
        
ReplaceString(filecontentsizeof(filecontent), "\r""");
        
        if (!
StrEqual(filecontent"")) AddFileToDownloadsTable(filecontent);
    }
    
    
CloseHandle(downloadfile);
}


public 
eventPlayerSpawn(Handle:event,const String:name[],bool:dontBroadcast
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if(
CheckCommandAccess(client"" ,ADMFLAG_CUSTOM5true))
    {
        
/*
        if(GetClientTeam(client) == 3)
        {
            SetEntityModel(client, CT_1_MODEL);    
        }*/
        
if(GetClientTeam(client) == 2)
        {
            
LogToGame("[VIP] Client %i's new model file is \"%s\""GetClientUserId(client), T_1_MODEL)   
            
SetEntityModel(clientT_1_MODEL);    
        }
    }

can i remove ModelDownloads(); from public OnPluginStart() and put it to public OnClientConnect() ??
sth like this?

PHP Code:
public OnClientConnect()
{
    
ModelDownloads();

BUT!!! when i compilet this.... it gived me this error:

SourcePawn Compiler 1.5.0-dev+3667
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

C:\Users\Dominik\Desktop\Scripting\include\cl ients.inc(75) : error 025: function heading differs from prototype
C:\Users\Dominik\Desktop\Scripting\temp864.sp (90) : error 025: function heading differs from prototype

2 Errors.

Compilation Time: 0,56 sec

so must do it from public OnClientPutInServer() ???
PHP Code:

public OnClientPutInServer()
{
    
ModelDownloads()


Please Help Me!
really is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-28-2012 , 09:42   Re: Models
Reply With Quote #9

try using sm_downloader first, see if it works before adding them hard coed like that into your script.
Mitchell is offline
really
Junior Member
Join Date: Sep 2012
Old 11-28-2012 , 10:47   Re: Models
Reply With Quote #10

u think this plugin? http://forums.alliedmods.net/showthread.php?p=602270
but how it works?
i must only add all this text :

materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_upperbody_variantc.vmt
materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_shared.vmt
materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_lowerbody_variantc.vmt
materials/models/player/kirby/admin/admin_phoenix/tm_phoenix_head_variantC.vmt
materials/models/player/kirby/admin/admin_phoenix/admin_phoenix_upperbody_variantc.vtf
materials/models/player/kirby/admin/admin_phoenix/admin_phoenix_lowerbody_variantc.vtf
materials/models/player/kirby/admin/admin_phoenix/admin_phoenix_head_variantb.vtf
models/player/kirby/admin/admin_phoenix.dx90.vtx
models/player/kirby/admin/admin_phoenix.vvd
models/player/kirby/admin/admin_phoenix.mdl


to downloads_example and downloads_simple_example

Last edited by really; 11-28-2012 at 10:59. Reason: ...
really 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 07:15.


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