Author Topic: Help! ( "lua coders only" )  (Read 1746 times)

0 Members and 1 Guest are viewing this topic.

Offline Krasher

  • -=RND Help Center=-
  • WaffleBBQrz
  • ******
  • Posts: 2764
  • Karma: +75/-47
  • Gender: Male
  • PM me if you have questions.
    • View Profile
    • Forum Page
Help! ( "lua coders only" )
« 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!
-Admin Application-

Follow the rules or I will you.

Offline Majoras mask

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +15/-2
  • Gender: Male
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #1 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
you got it


Offline Krasher

  • -=RND Help Center=-
  • WaffleBBQrz
  • ******
  • Posts: 2764
  • Karma: +75/-47
  • Gender: Male
  • PM me if you have questions.
    • View Profile
    • Forum Page
Re: Help! ( "lua coders only" )
« Reply #2 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
« Last Edit: May 12, 2010, 12:07:00 PM by Kräsh∑r »
-Admin Application-

Follow the rules or I will you.

Offline Majoras mask

  • Sr. Member
  • ****
  • Posts: 449
  • Karma: +15/-2
  • Gender: Male
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #3 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
you got it


Offline Krasher

  • -=RND Help Center=-
  • WaffleBBQrz
  • ******
  • Posts: 2764
  • Karma: +75/-47
  • Gender: Male
  • PM me if you have questions.
    • View Profile
    • Forum Page
Re: Help! ( "lua coders only" )
« Reply #4 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 :/
-Admin Application-

Follow the rules or I will you.

Offline Peetah

  • Unnecessary encouragement guy.
  • Übermensch
  • *****
  • Posts: 877
  • Karma: +16/-4
  • Gender: Male
  • And God saw that it was Good.
    • View Profile
    • Youtube Account
Re: Help! ( "lua coders only" )
« Reply #5 on: May 12, 2010, 12:16:01 PM »
I dont see anything wrong. Mabe just me lol.





Offline Frank

  • No.
  • WaffleBBQrz
  • ******
  • Posts: 4058
  • Karma: +94/-45
  • Gender: Male
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #6 on: May 12, 2010, 02:59:09 PM »
Steal TTT dropping shiz.

Offline ƒąĢĢǿŧ™

  • -=RND Trolling Center=-
  • WaffleBBQrz
  • ******
  • Posts: 3334
  • Karma: +59/-76
  • Gender: Male
  • What's going on here?
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #7 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.


Offline coolzeldad

  • Zagnipple
  • Administrator
  • Übermensch
  • *****
  • Posts: 1343
  • Karma: +95/-11
  • mhmmz
    • View Profile
    • .:`=-~rANdOm~`-=:.
Re: Help! ( "lua coders only" )
« Reply #8 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 )
« Last Edit: May 13, 2010, 04:25:03 AM by coolzeldad »
"The masses are asses" - Thomas Jefferson

.:~RND`=- Devie ♥: IM WATCHING BABIES

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter then "Yes"

Offline Krasher

  • -=RND Help Center=-
  • WaffleBBQrz
  • ******
  • Posts: 2764
  • Karma: +75/-47
  • Gender: Male
  • PM me if you have questions.
    • View Profile
    • Forum Page
Re: Help! ( "lua coders only" )
« Reply #9 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
« Last Edit: May 13, 2010, 12:56:52 PM by Kräsh∑r »
-Admin Application-

Follow the rules or I will you.

Offline Frank

  • No.
  • WaffleBBQrz
  • ******
  • Posts: 4058
  • Karma: +94/-45
  • Gender: Male
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #10 on: May 13, 2010, 12:57:07 PM »
READ MY COMMENT?

STEAL TTT

Offline Krasher

  • -=RND Help Center=-
  • WaffleBBQrz
  • ******
  • Posts: 2764
  • Karma: +75/-47
  • Gender: Male
  • PM me if you have questions.
    • View Profile
    • Forum Page
Re: Help! ( "lua coders only" )
« Reply #11 on: May 13, 2010, 12:57:42 PM »
READ MY COMMENT?

STEAL TTT
-.-, that is not what this is about Frank.
-Admin Application-

Follow the rules or I will you.

Offline Frank

  • No.
  • WaffleBBQrz
  • ******
  • Posts: 4058
  • Karma: +94/-45
  • Gender: Male
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #12 on: May 13, 2010, 12:59:50 PM »
Oh k sry.

Me be nub. Keel me or asplode me pl0z

Offline » Magic «

  • Who dares wins
  • WaffleBBQrz
  • ******
  • Posts: 4020
  • Karma: +101/-34
  • Gender: Male
  • Prepare for the worst :D
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #13 on: May 13, 2010, 01:29:28 PM »
Oh k sry.

Me be nub. Keel me or asplode me pl0z


* «-= Magic =-» Rocketed Frank(23.74.55.12:2750 - STEAM_0_5128347) @ 21:28 - 13.05.2010
« Last Edit: May 13, 2010, 01:31:28 PM by «-= Magic =-» »
Copyright© .:~`=-rANdOm-=`~:. GameServer's Administration Team 2008/2009/2010


bubbly bubbly so darn bubbly

Offline carphunter963

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +20/-12
  • Gender: Male
  • Gravity Carp Not Amused
    • View Profile
Re: Help! ( "lua coders only" )
« Reply #14 on: May 13, 2010, 03:16:07 PM »
lol nice avatar magik


130 kills, or something around that.