Raised This Month: $ Target: $400
 0% 

Simple Model Plugin Error


Post New Thread Reply   
 
Thread Tools Display Modes
headline
SourceMod Moderator
Join Date: Mar 2015
Old 05-16-2015 , 19:46   Re: Simple Model Plugin Error
Reply With Quote #11

Quote:
Originally Posted by Mitchell View Post
SetEntityModel(client, "player/kuristaja/nanosuit/nanosuit.mdl");
->
SetEntityModel(client, "models/player/kuristaja/nanosuit/nanosuit.mdl");

Also you only need to precache the .mdl path:
PrecacheModel("player/kuristaja/nanosuit/nanosuit.mdl");
Got it working now! Thanks so much!
headline is offline
Chokitu
Senior Member
Join Date: Oct 2013
Old 05-16-2015 , 20:50   Re: Simple Model Plugin Error
Reply With Quote #12

Headlinem can you add me in skype?
chokitu3
Chokitu is offline
Send a message via Skype™ to Chokitu
headline
SourceMod Moderator
Join Date: Mar 2015
Old 05-16-2015 , 21:07   Re: Simple Model Plugin Error
Reply With Quote #13

A friend of mine helped me out. I have one more request, though. How would I make it so that when I join the server and I have ADMFLAG_RCON. It'll automatically give the model to me. You guys are the best!


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


#pragma semicolon 1 

// Plugin Info 
public Plugin:myinfo =    
{    
    
name "Models",    
    
author "Headline",    
    
description "Hunger Games Models",    
    
version "2.0",    
    
url "http://www.allied-gamers.com"    
}    

// On plugin start 
public OnPluginStart() 

    
RegAdminCmd("sm_model"command_modelADMFLAG_GENERIC"Gives Model"); 


// On Map Start Download/Pre-cache 
public OnMapStart() 
{
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit_arms.dx90.vtx");
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit_arms.vvd");
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit_arms.mdl");
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit.phy");
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit.vvd");
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit.mdl");
    
PrecacheModel("models/player/kuristaja/nanosuit/nanosuit.dx90.vtx");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit_arms.dx90.vtx");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit_arms.vvd");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit_arms.mdl");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit.phy");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit.vvd");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit.mdl");
    
AddFileToDownloadsTable("models/player/kuristaja/nanosuit/nanosuit.dx90.vtx");



// Command sm_model function 
public Action:command_model(clientargs
{
    
// NAME STORAGE 
    
new String:name[32]; 
    
GetClientName(clientnamesizeof(name)); 

    
// ERRORS 
    
if(args 0)
    {
        
PrintToConsole(client"[SM] Usage: sm_model"); 
        return 
Plugin_Handled;
    }
    
CPrintToChatAll("[AG] Hunger Games: %s has chosen a skin"name);
    
// SETTING PLAYER MODELS
    
SetEntityModel(client"models/player/kuristaja/nanosuit/nanosuit.mdl");
    
SetEntPropString(clientProp_Send"m_szArmsModel""models/player/kuristaja/nanosuit/nanosuit_arms.mdl");
    return 
Plugin_Handled;

headline is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 05-16-2015 , 21:35   Re: Simple Model Plugin Error
Reply With Quote #14

think it'd be

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if(!
CheckCommandAccess(client""ADMFLAG_RCONtrue))
        return;
    
    
SetEntityModel(client"models/player/kuristaja/nanosuit/nanosuit.mdl"); 
    
SetEntPropString(clientProp_Send"m_szArmsModel""models/player/kuristaja/nanosuit/nanosuit_arms.mdl");

Miu 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 14:25.


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