Raised This Month: $89 Target: $400
 22% 

model problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
generals
Member
Join Date: Aug 2018
Old 09-09-2019 , 08:11   model problem
Reply With Quote #1

hi guys

i want to add model to end human

whats the problem?

i waiting for your help.. tnx

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

new Handle:hModel INVALID_HANDLE;

new 
String:model[256];

public 
OnPluginStart()
{
    
hModel CreateConVar("lh_model""models/player/bunny/bunny_funny.mdl");

    
HookEvent("round_end"Event_OnRoundEnd);
}

public 
OnMapStart()
{
    
GetConVarString(hModelmodelsizeof(model));
    
AddFileToDownloadsTable(model);
    
PrecacheModel(model);
}

public 
Event_OnRoundEnd(Handle:event, const String:name[], bool:silent)
{
    new 
CountPlayer 0Client 0;

    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
CountPlayer++;
            
Client i;
        }
    }

    if (
CountPlayer == && Client 0)
    {
        
SetEntityModel(Clientmodel);
    }


Last edited by generals; 09-10-2019 at 03:22.
generals is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-09-2019 , 22:11   Re: model problem
Reply With Quote #2

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

new Handle:hModel INVALID_HANDLE;

new 
String:model[256];

public 
OnPluginStart()
{
    
hModel CreateConVar("lh_model""player/bunny/bunny_funny.mdl");

    
HookEvent("round_end"Event_OnRoundEnd);
}

public 
OnMapStart()
{
    new 
String:buffer[256];
    
GetConVarString(hModelmodelsizeof(model));
    
PrecacheModel(model);
    
Format(buffersizeof(buffer), "sound/%s"model);
    
AddFileToDownloadsTable(buffer);
}

public 
Event_OnRoundEnd(Handle:event, const String:name[], bool:silent)
{
    new 
CountPlayer 0Client 0;

    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            
CountPlayer++;
            
Client i;
        }
    }

    if (
CountPlayer == && Client 0)
    {
        
SetEntityModel(Clientmodel);
    }

__________________
Taking paid private requests! Add me on steam!

Discord: Cruze#4947 | AlliedModders Releases | Github | Steam | PayPal
Cruze is offline
generals
Member
Join Date: Aug 2018
Old 09-10-2019 , 03:26   Re: model problem
Reply With Quote #3

hi

really thanks .. but don't worked

why used (sound/%s) ?

i changed it to (models/%s) and i used (ZR_IsClientHuman(i)) but don't work again

what can i do?

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

new Handle:hModel INVALID_HANDLE;

new 
String:model[256];

public 
OnPluginStart()
{
    
hModel CreateConVar("lh_model""player/bunny/bunny_funny.mdl");

    
HookEvent("round_end"Event_OnRoundEnd);
}

public 
OnMapStart()
{
    new 
String:buffer[256];
    
GetConVarString(hModelmodelsizeof(model));
    
PrecacheModel(model);
    
Format(buffersizeof(buffer), "models/%s"model);
    
AddFileToDownloadsTable(buffer);
}

public 
Event_OnRoundEnd(Handle:event, const String:name[], bool:silent)
{
    new 
CountPlayer 0Client 0;

    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i))
        {
            
CountPlayer++;
            
Client i;
        }
    }

    if (
CountPlayer == && Client 0)
    {
        
SetEntityModel(Clientmodel);
    }


Last edited by generals; 09-10-2019 at 05:30.
generals is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-11-2019 , 01:11   Re: model problem
Reply With Quote #4

Quote:
Originally Posted by generals View Post

why used (sound/%s) ?
Yeah my bad
Quote:
i changed it to (models/%s) and i used (ZR_IsClientHuman(i)) but don't work again

what can i do?
Check error logs
__________________
Taking paid private requests! Add me on steam!

Discord: Cruze#4947 | AlliedModders Releases | Github | Steam | PayPal
Cruze is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-11-2019 , 02:51   Re: model problem
Reply With Quote #5

do you want the last human to have the skin NEXT round? Or do you only want to set the player's model before the next round starts?
__________________
8guawong is offline
generals
Member
Join Date: Aug 2018
Old 09-11-2019 , 08:13   Re: model problem
Reply With Quote #6

Quote:
Originally Posted by Cruze View Post
Yeah my bad

Check error logs
no error logs.. plugin don't work .. doesn't change model

Quote:
Originally Posted by 8guawong View Post
do you want the last human to have the skin NEXT round? Or do you only want to set the player's model before the next round starts?
i want to set player model before the next round start .. after round end player model back to the default

Last edited by generals; 09-11-2019 at 08:13.
generals is offline
generals
Member
Join Date: Aug 2018
Old 09-13-2019 , 14:27   Re: model problem
Reply With Quote #7

hi again

this can help?

https://forums.alliedmods.net/showth...ighlight=human
https://forums.alliedmods.net/showth...ighlight=human
generals is offline
Reply


Thread Tools
Display Modes

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:23.


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