.:`=-~rANdOm~`-=:.

Tech Lounge => Programming => Topic started by: Krasher on May 12, 2010, 11:53:11 AM

Title: Help! ( "lua coders only" )
Post by: Krasher on May 12, 2010, 11:53:11 AM
I have just recently began making another gamemode, Prop Arena, and I cannot seem to get the Gamemode to make the player drop his weapons and get what I want him to have.

Current Code (Without TAB spacing):
Code: [Select]
function GM:PlayerLoadout( ply )
ply:StripWeapons()
ply:Give( "weapon_zm_carry" )
end

help!
Title: Re: Help! ( "lua coders only" )
Post by: Majoras mask on May 12, 2010, 12:03:20 PM
I think stripweapons() isn't in caps

Code: [Select]
function GM:PlayerLoadout( pl )

        ply:stripweapons()
        ply:Give( "weapon_crowbar" )
        ply:Give( "weapon_pistol" )
end

I'm probably wrong but just try it


that's what I did when i was first trying out lua
Title: Re: Help! ( "lua coders only" )
Post by: Krasher on May 12, 2010, 12:05:28 PM
I think stripweapons() isn't in caps

Quote
function GM:PlayerLoadout( pl )

        ply:stripweapons()
        ply:Give( "weapon_crowbar" )
        ply:Give( "weapon_pistol" )
end

I'm probably wrong but just try it


that's what I did when i was first trying out lua
1.) Your function targets are off (pl to ply)
2.) StripWeapons is a function. It will be in caps.

HELP MEEE
Title: Re: Help! ( "lua coders only" )
Post by: Majoras mask on May 12, 2010, 12:06:09 PM
1.) Your function targets are off (pl to ply)
2.) StripWeapons is a function. It will be in caps.

HELP MEEE

pl and ply do the same thing
Title: Re: Help! ( "lua coders only" )
Post by: Krasher on May 12, 2010, 12:08:39 PM
pl and ply do the same thing
Nope, when you set your self.BaseClass.PlayerInititialize( ply ), it knows that ply is your player.

EDIT:// Unless self.BaseClass.PlayerInitialize( pl, ply )

Hurp Durp, think of solutions xD...

Will try the no caps thing, prob won't work sadly :/
Title: Re: Help! ( "lua coders only" )
Post by: Peetah on May 12, 2010, 12:16:01 PM
I dont see anything wrong. Mabe just me lol.
Title: Re: Help! ( "lua coders only" )
Post by: Frank on May 12, 2010, 02:59:09 PM
Steal TTT dropping shiz.
Title: Re: Help! ( "lua coders only" )
Post by: ƒąĢĢǿŧ™ on May 13, 2010, 01:28:47 AM
Sorry I can't help.
I only know a bit of lua.
Maybe use Frank's suggestion.
Title: Re: Help! ( "lua coders only" )
Post by: coolzeldad on May 13, 2010, 04:23:26 AM
What exactly is happening when you execute the function?

Are you running this serverside?

Maybe try with a weapon you know will work (if it's that issue)

Put a print command in the function to see if it's running ( if that's the issue )
Title: Re: Help! ( "lua coders only" )
Post by: Krasher on May 13, 2010, 12:54:56 PM
What exactly is happening when you execute the function?

Are you running this serverside?

Maybe try with a weapon you know will work (if it's that issue)

Put a print command in the function to see if it's running ( if that's the issue )
mmk will do.

Current Code: (init.lua) so little because I had to restart and I am trying to fix this before I go on to anything else.
Code: [Select]
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include( 'shared.lua' )

/*------------------------------------------

  KRASHER RULES :D, remember to say thanks

------------------------------------------*/

function GM:PlayerSpawn( ply )
self.BaseClass:PlayerSpawn( ply )
ply:SetGravity( 0, 90 )
ply:SetMaxHealth( 125, true )
ply:SetMaxSpeed( 345, 545 )
end

function GM:PlayerLoadout( ply )
ply:StripWeapons()
ply:Give("weapon_zm_carry")
end

function GM:PlayerInitialSpawn( ply )
self.BaseClass:PlayerInitialSpawn( ply )
ply:PrintMessage( HUD_PRINTTALK, "Hello, you are playing", GM.Name, "v", GM.Version)
end
Title: Re: Help! ( "lua coders only" )
Post by: Frank on May 13, 2010, 12:57:07 PM
READ MY COMMENT?

STEAL TTT
Title: Re: Help! ( "lua coders only" )
Post by: Krasher on May 13, 2010, 12:57:42 PM
READ MY COMMENT?

STEAL TTT
-.-, that is not what this is about Frank.
Title: Re: Help! ( "lua coders only" )
Post by: Frank on May 13, 2010, 12:59:50 PM
Oh k sry.

Me be nub. Keel me or asplode me pl0z
Title: Re: Help! ( "lua coders only" )
Post by: » Magic « on May 13, 2010, 01:29:28 PM
Oh k sry.

Me be nub. Keel me or asplode me pl0z


/me Rocketed Frank(23.74.55.12 (http://1227.com):2750 - STEAM_0_5128347) @ 21:28 - 13.05.2010
Title: Re: Help! ( "lua coders only" )
Post by: carphunter963 on May 13, 2010, 03:16:07 PM
lol nice avatar magik
Title: Re: Help! ( "lua coders only" )
Post by: Peetah on May 13, 2010, 06:47:23 PM
lol so thats what magik was up to. RAPEIN lil girls. lol
Title: Re: Help! ( "lua coders only" )
Post by: » Magic « on May 14, 2010, 04:10:26 PM
It's OMG faic
Title: Re: Help! ( "lua coders only" )
Post by: Nightfire757 on June 22, 2010, 03:40:10 AM
Yo if you still need help with your problem im sure i can fix it for you.....i made a couple of gamemods that drop your weapons when you die and im sure i can rig it so yours will work just pm me if you still need some help with it and ill look into it more