Raised This Month: $ Target: $400
 0% 

Solved i need help to replace a prop model with custom one


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
rory98
Junior Member
Join Date: Oct 2021
Old 10-20-2021 , 22:20   i need help to replace a prop model with custom one
Reply With Quote #1

i have searched the forum for script to change a prop model with a custom one,i found this,what im trying to do is to change the ammo pile model to a custom one
the code compile just fine, but the game wont load and crashes with this error :
588/ - weapon_ammo_spawn: UTIL_SetModel: not precached: models/witch_bowl/bowl.mdl

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

public OnMapStart() 
{ 
    PrecacheModel("models/witch_bowl/bowl.mdl"); 
} 

public void OnEntityCreated(entity, const String:classname[]) 
{ 

    if ( StrEqual(classname, "weapon_ammo_spawn") ) 
    { 
        SDKHook(entity, SDKHook_SpawnPost, Hook_EntitySpawned); 
    } 
} 

public void Hook_EntitySpawned(entity) 
{ 
    if(IsValidEntity(entity)) 
    { 
        SetEntityModel(entity, "models/witch_bowl/bowl.mdl"); 
    } 
}
__________________
rory

Last edited by rory98; 10-22-2021 at 20:48.
rory98 is offline
 



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 01:47.


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