Raised This Month: $60 Target: $400
 15% 

Solved model problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
generals
Senior 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-23-2019 at 06:15.
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!

AlliedModders Releases | Github | Private Plugins | PayPal | Steam | Discord: Cruze#4947
Cruze is offline
generals
Senior 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!

AlliedModders Releases | Github | Private Plugins | PayPal | Steam | Discord: Cruze#4947
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
Senior 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
Senior 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
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-20-2019 , 09:29   Re: model problem
Reply With Quote #8

Quote:
Originally Posted by generals View Post
no error logs.. plugin don't work .. doesn't change model



i want to set player model before the next round start .. after round end player model back to the default
hi you save the index of last human
and on player spawn if the index match the index of last human than set the player's model to what you want
__________________
8guawong is offline
generals
Senior Member
Join Date: Aug 2018
Old 09-20-2019 , 16:35   Re: model problem
Reply With Quote #9

Quote:
Originally Posted by 8guawong View Post
hi you save the index of last human
and on player spawn if the index match the index of last human than set the player's model to what you want
hi

how can i fix this? please.. can u help me ?
generals is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-21-2019 , 07:50   Re: model problem
Reply With Quote #10

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

new Handle:hModel INVALID_HANDLE;

new 
String:model[256];

new 
bool:g_Winner[MAXPLAYERS+1];

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

    
HookEvent("player_spawn"Event_OnPlayerSpawn
    HookEvent
("round_end"Event_OnRoundEnd);
}

public 
OnPlayerDisconnect(client)
{
    
g_Winner[client] = false;
}

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

public 
Event_OnPlayerSpawn(Handle:event, const String:name[], bool:silent)
{
    
int client GetClientOfUserId(GetEventInt("userid"));
    if(
client && client <= MaxClients && IsClientInGame(client) && g_Winner[client])
    {
         
SetEntityModel(clientmodel);
    }
}

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

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

    if (
CountPlayer == && Client && Client <= MaxClients && IsClientInGame(Client))
    {
        
g_Winner[Client] = true;
    }

__________________
Taking paid private requests! Add me on steam/discord!

AlliedModders Releases | Github | Private Plugins | PayPal | Steam | Discord: Cruze#4947

Last edited by Cruze; 09-21-2019 at 07:53.
Cruze 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 04:19.


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