Been following [URL="http://wiki.garrysmod.com/?title=Simple_Gamemode"]this tutorial[/URL] on Garrysmod.com, completed it without doing everything on there like the unnecessary teams, what my problem is, is that when calling a fuction from the Specialchars file (it is included in my file) it doesn't actually excecute the function, any ideas, here's the part of my init.lua and all of my Specialchars.lua, help would be appreciated as would love to learn this highly flexible and fairly impressive coding language.
[B]Init.lua
[/B][LUA]function GM:PlayerInitialSpawn( ply )
CheckSpecialCharacters( ply )
if ply:IsAdmin() then
sb_team2 ( ply )
else
sb_team1 ( ply )
end
end[/LUA]
[B]Specialchars.lua
[/B][LUA]function CheckSpecialCharacters( ply )
if ( ply:SteamID() == "STEAM_0:1:14504747" ) then
ply:PrintMessage( HUD_PRINTTALK, "Welcome, " .. ply:Nick() .. "\nYou connected under the IP: " .. ply:IPAddress() )
ply:SetTeam( 2 )
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_pistol" )
ply:Give( "weapon_smg1" )
ply:Give( "weapon_frag" )
ply:Give( "weapon_physcannon" )
ply:Give( "weapon_crossbow" )
ply:Give( "weapon_shotgun" )
ply:Give( "weapon_357" )
ply:Give( "weapon_rpg" )
ply:Give( "weapon_ar2" )
ply:Give( "gmod_tool" )
ply:Give( "gmod_camera" )
ply:Give( "weapon_physgun" )
end
end[/LUA]
Are you sure it's not running? Are you including Specialchars.lua before PlayerInitialSpawn?
Oh silly me, it's calling a function if the player is an admin, seeing as I always create the server, I'm gonna be an admin, so it was executing the "sb_team2" function, which only gave me some weapons, not the ones in the Specialchars.lua, now my initialspawn function is as follows:
[LUA]function GM:PlayerInitialSpawn( ply )
CheckSpecialCharacters( ply )
sb_team1 ( ply )
end[/LUA]
Sorry for posting the unnecessary thread guys.
Sorry, you need to Log In to post a reply to this thread.