Gamemode help :S

why is is out of order?

cl_init.lua ----



include ('shared.lua')



init.lua ----



AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include ('shared.lua')


function GM:PlayerInitialSpawn( ply )

ply:SetTeam(1)

end


function GM:PlayerLoadout( ply )

	ply:StripWeapons()
	
	if ply:Team = 1 then
	
	ply:Give("weapon_physcannon")
	
	end

end



shared.lua ----



GM.Name = "Stargate"
GM.Author = "SSMG"
GM.Email = "gabesz1995@citromail.hu"
GM.Website = "N/A"

team.SetUp(1,"Tauri",Color(0,128,0,255))
team.SetUp(2,"Goa'uld",Color(0,128,0,255))
team.SetUp(1,"Free Jaffa",Color(0,128,0,255))




(User was banned for this post ("Wrong section" - mahalis))

Firstly, put your code inside lua tags.

Secondly, the very last line of shared.lua, team.SetUp should start with 3 and not 1?

Thirdly, what do you mean out of order?

[editline]03:28PM[/editline]

Fourthly, the line in init.lua which says “if ply:Team = 1 then” should be:


if ply:Team() == 1 then

1st post the code in [lua][/lua] tags.
2nd what is out of order?

When I spawn I get weaponS physcannon,stunstick,crowbar,smg,etc.

This means there is an error in the script. Inside your console, this error will be there somewhere. Do what I said above, and it should work.

okey I try that

[editline]02:36PM[/editline]

gamemodes\stargate\gamemode\init.lua:16: function arguments expected near ‘==’



********** COULDN’T LOAD GAMEMODE!! **********



There was a problem opening the gamemode file ‘Stargate/gamemode/init.lua’

Registering gamemode ‘Stargate’ derived from ‘base’

[editline]02:37PM[/editline]

So it is not ==

[editline]02:39PM[/editline]



AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include ('shared.lua')


function GM:PlayerInitialSpawn( ply )

ply:SetTeam(1)

end

function GM:PlayerLoadout( ply )

	ply:StripWeapons()
	
	if ply:Team = 1 then
	
	ply:Give("weapon_physcannon")
	
	end

end


[editline]02:40PM[/editline]

I can’t use [lua] or what?

Line 16, if ply:Team() == 1 then .

EDIT:

This thread belongs in the newbie questions.

He said it, now I corrected it

[editline]02:47PM[/editline]

lol???




gamemodes\stargate\gamemode\init.lua:16: function arguments expected near '='
**********************************************
**********************************************
********** COULDN'T LOAD GAMEMODE!! **********
**********************************************
**********************************************

There was a problem opening the gamemode file 'Stargate/gamemode/init.lua'


Registering gamemode 'Stargate' derived from 'base'



[editline]02:48PM[/editline]

function arguments expected near ‘==’
function arguments expected near ‘=’

theeeeen wtf?

No, you did not fix it. Do what I said.

Also, your having this simple an issue proves that you don’t know lua hardly enough at all. You’re certainly not going to make a gamemode.

I DID that…

[editline]02:54PM[/editline]

http://img62.imageshack.us/img62/4890/luat.png

Uploaded with ImageShack.us

http://img508.imageshack.us/img508/9935/hl22010062616482913.jpg

Uploaded with ImageShack.us

[editline]02:55PM[/editline]

see?

You did what thomasfn said, which was wrong. Read Bletotum’s post.

so only =?



if ply:Team() == 1 then


oh I see sorry

Ahh I didn’t see the missing brackets, I only saw the missing = sign. My bad, sorry for confusion.