• Is anyone able to tell me what's wrong with this? (Gmod Prophunt)
    8 replies, posted
[QUOTE] // Called by spawn and sets loadout function CLASS:Loadout(pl) pl:GiveAmmo(64, "Buckshot") pl:GiveAmmo(255, "SMG1") pl:Give("weapon_crowbar") pl:Give("weapon_shotgun") pl:Give("weapon_smg1") pl:Give("item_ar2_grenade") [B]if (pl:SteamID == "STEAM_0:0:20709865") then pl:SetModel( "models\slow\arkham_cityum\joker\slow.mdl") end[/B] local cl_defaultweapon = pl:GetInfo("cl_defaultweapon") if pl:HasWeapon(cl_defaultweapon) then pl:SelectWeapon(cl_defaultweapon) end end [/QUOTE] The bit in [B]Bold[/B] is the code i added to change my skin to a custom one. The skin is in my server as well as the fastdl folder. The game seems to screw up in the aspect of hunters spawning with no weapons, and if i comment out the bold part, the game runs fine. Any Advice would be highly appreciated.
You can't use \ to reference folders. \ is almost universally used as an escape character in coding. So \n means new line. \t usually means tabular. \" means print the ". Replace the \s with /s Here: [lua]// Called by spawn and sets loadout function CLASS:Loadout(pl) pl:GiveAmmo(64, "Buckshot") pl:GiveAmmo(255, "SMG1") pl:Give("weapon_crowbar") pl:Give("weapon_shotgun") pl:Give("weapon_smg1") pl:Give("item_ar2_grenade") if (pl:SteamID( ) == "STEAM_0:0:20709865") then pl:SetModel( "models/slow/arkham_cityum/joker/slow.mdl") end local cl_defaultweapon = pl:GetInfo("cl_defaultweapon") if pl:HasWeapon(cl_defaultweapon) then pl:SelectWeapon(cl_defaultweapon) end end[/lua]
if pl:SteamID() == ... SteamID is a function, not a variable. Also what Acecool says. Windows is stupid and tried to force people to use \ but it's almost exclusively for escaping (outside of Windows) so always use / for paths.
:suicide: I seriously hate windows sometimes lol.. Thanks Ace, ill check out the code and get back to you guys if it still doesn't work
If it works, feel free to mark the thread as solved up at the top left near the reply button to avoid confusion with others :-)
odd, It still wont show. Thanks anyway guys, ill get someone i know whos done it before to check over my files..
There are actually other hooks that get called on spawn. I believe Loadout is first. You may actually want to hook into function GM:PlayerSetModel ( Player ) -- Called SERVERside using: [lua]hook.Add( "PlayerSetModel", "MySuperPersonalAndPrivateModel", function( _p ) if ( _p:SteamID( ) == "STEAM_0:0:20709865" ) then pl:SetModel( "models/slow/arkham_cityum/joker/slow.mdl" ); end end )[/lua]
Ok I got the player models working as such, had to actually find a model designed for player usage. But I got a new problem. First off, I found the Masterchief player model and decided to use that. I put the Lua file that came with it inside lua/autorun. Bzipped the models and materials for the skin and put them into the fastdl folder. Edited the resource.lua file to add the "mastechief_player.mdl" file with the directory showing where it was, using the line [QUOTE]resource.AddFile("models/halo4/spartans/masterchief_player.mdl")[/QUOTE]. I see the model ingame but everyone else see's an error. And in the console it says that the model is missing from the directory models/halo4/spartans/ but thats the thing, It is in the fastdl directory. So it should download? I tried the URL in my browser for my Fastdl and i can access it fine. I checked the configs and everything seems right. only thing i have not done is put the model physically into my servers models folder etc.. If anyone can tell me what the issue is your going to save me a major headache, not like i haven't had them from trying to fix it.. [editline]4th August 2013[/editline] now it works. Go figure. Added all files directly to the gmod server folder
It needs to be in the FastDL directory, and in the server. If you resource.AddFile a non-existent file, it won't download. Edit: Just saw you edited with it working. Please feel free to mark this topic as solved if you've solved it all, located in the upper left corner next to the reply button :-)
Sorry, you need to Log In to post a reply to this thread.