I have three incredibly stupid questions, that have left me stumped;
1) In my gamemode, it won't let me set the player model. It just doesn't load. No errors. Nothing. What's wrong?
2) How do i put information on my team_menu, so it would like the menu when selecting map/gamemode in GMod. Something like this; [url]http://img33.imageshack.us/img33/7972/menuthing.jpg[/url]
3) I'm want my gamemode to be third person. I found a simple code that allows this, but my player doesn't have a head. Is there a way around this?
Thanks in advance.
Edit: I forgot to ask (this ones kind of a biggy) just how would i go about making a HUD, that had five images (1 - guy standing normally, 5 - guy leaning on side on screen bleeding) that changed depending on your health eg. 100hp - 80hp: standing normally, 80hp - 60hp: crouching slightly, 60hp - 40hp: bleeding, catching breath etc.
Again, help would be much appreciated.
to change the model of the player you have to call the model each time he spawns
you should have it set up on playerspawn and not on playerloadout
"function GM:PlayerSpawn( ply )
if ply:Team() == 1 then
ply:SetModel( "model here" )
elseif ply:Team() == 2 then
ply:SetModel( "second model here" )
end
end"
hope this solves your first problem.
[QUOTE=meka/sniper;16020250]to change the model of the player you have to call the model each time he spawns
you should have it set up on playerspawn and not on playerloadout
"function GM:PlayerSpawn( ply )
if ply:Team() == 1 then
ply:SetModel( "model here" )
elseif ply:Team() == 2 then
ply:SetModel( "second model here" )
end
end"
hope this solves your first problem.[/QUOTE]
I'm an idiot. Thankyou so much :)
Edit: One more thing; where it says "if ply:Team() == 1 then" do you have to write the name of team in the brackets? or parenthesus or something, whatever you wanna call them.
when you set up a team using :
team.SetUp( 1, "team red", Color( 255, 50, 50, 255 ) )
you assign the team's number to 1 so when it checks all you need to have is
if ply:Team() == 1 its really checking if ply:Team() == team red i guess you could say
You can also do
team.SetUp(TEAM_RED, "Team Red", Color(255, 0, 0, 255))
and then you would check the team by
if Pl:Team() == TEAM_RED then
[b]meka/sniper:[/b] For future reference, use lua tags. [ lua] [/lua] (without the space)
OK, i've done that. It works (thankyou guys :D), BUT the player model doesn't have any animations, it's gone all war of the servers mingebag like, and you don't s[awn with any weapons. Help...
[QUOTE=avwos;16037851]OK, i've done that. It works (thankyou guys :D), BUT the player model doesn't have any animations, it's gone all war of the servers mingebag like, and you don't spawn with any weapons. Help...[/QUOTE]
Add weapons to the players spawn function, this might also fix the problems with the animations.
[lua]
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_pistol" )
ply:Give( "weapon_smg1" )
[/lua]
[QUOTE=Jamie932;16035352][b]meka/sniper:[/b] For future reference, use lua tags. [ lua] [/lua] (without the space)[/QUOTE]
Thanks i didn't know the command for that.
[QUOTE=meka/sniper;16037938]Add weapons to the players spawn function, this might also fix the problems with the animations.
[lua]
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_pistol" )
ply:Give( "weapon_smg1" )
[/lua]
Thanks i didn't know the command for that.[/QUOTE]
I've done all that, it was working fine, equiping them with a pistol, fists, talk SWEP, some random WW2 rifle and a molotov, but after i put that it, it's stopped working.
What is the current code you are using for spawning the giving the player a loadout?
[QUOTE=meka/sniper;16038010]What is the current code you are using for spawning the giving the player a loadout?[/QUOTE]
What do you mean the code?
This?;
[LUA]
function GM:PlayerLoadout( ply )
if ply:Team() == 1 then
ply:Give( "talk" ) //talk swep
ply:Give( "hl2_combo_fists" ) //AWESOME fist swep
ply:Give( "berettaReal" ) //beretta swep
ply:Give( "rg_ZKar98k" ) //WW2 rifle from DoD
ply:Give( "molotovReal" ) //molotov swep
elseif ply:Team() == 2 then
ply:Give( "berettaReal" ) //beretta swep
ply:Give( "talk" ) //talk swep
ply:Give( "weapon_stunstick" ) //give stunstick
ply:Give( "AR2" ) //give AR2
ply:Give( "weapon_dynamic_resupply" ) //give grenade
elseif ply:Team() == 3 then
ply:Give( "berettaReal" )
ply:Give( "Healthkit" )
ply:Give( "item_battery", 5 )
elseif ply:Team() == 4 then
ply:Give( "berettaReal" )
ply:Give( "Healthkit" )
ply:Give( "item_battery", 5 )
end //Here we end the if condition
end //Here we end the Loadout function
[/LUA]
Hmm are you sure those are the right paths for the weapons because i know the path for an ar2 is :
" weapon_ar2 " double check that you are using the right paths for the items.
If that's not the problem try putting the ply:Give's into your PlayerSpawn function.
I've got it working again (yay :D) the AR2 is a SWEP; it has an iron sight.
Sorry, you need to Log In to post a reply to this thread.