Question 1 : How to find Pre fuctions list Like ply:give vb.
Question 2: What am i doing wrongg???
What am i doing wrong??
Shared :
[CODE]GM.Name = "Prop Killers"
GM.Author = "GoldenRifle"
GM.Email = "can.boluk.89@gmail.com"
GM.Website = "www.canboluk.com"
--Code Starts Here
function GM.Initialize()
self.BaseClass.Initialize( self )
end[/CODE]
cl_init
[CODE]include ( 'shared.lua' )
[/CODE]init
[CODE]AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include ( 'shared.lua' )
function GM:PlayerSpawn ( ply )
self.BaseClass:PlayerSpawn( ply )
ply:SetMaxHealth( 200, true )
end
function GM:PlayerLoadOut ( ply )
ply:StripWeapons()
ply:Give( "weapon_frag" )
ply:Give( "weapon_physcannon" )
ply:Give( "weapon_slam" )
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_stunstick" )
ply:ChatPrint(ply:Nick() .. ", You have been given the Basic-Weapons.")
ply:GiveAmmo( 4, "Frag", true )
end
function GM:PlayerInitialSpawn ( ply )
self.BaseClass:PlayerInitialSpawn( ply)
ply:ChatPrint("Welcome," .. ply:Nick() .. "! Have a nice time!")
end
[/CODE]
propkillers.txt
[QUOTE]
"Gamemode"
{
"base" "base"
"title" "Prop Killers"
"maps" "^de_" [LITTLE QUESTION HERE HOW CAN I DO LIKE ^de_ , ^cs_] NOT INSERTED IN ORGINAL FILE
"menusystem" "1"
"settings"
{
1
{
"name" "pk_allowgr"
"text" "Frags Allowed?"
"help" "If you wanna allow frags change to 1 else change to 0"
"type" "numeric"
"default" "20"
}
2
{
"name" "pk_open"
"text" "Open?"
"help" "Prop Killers On?"
"type" "checkbox"
"default" "1"
}
}
}
[/QUOTE]
I don't know, what [I]are[/I] you doing wrong?
You should go read some articles on the wiki before asking questions.
[lua]AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include ( 'shared.lua' )
function GM:PlayerSpawn ( ply )
self.BaseClass:PlayerSpawn( ply )
ply:SetMaxHealth( 200, true )
end
function GM:PlayerLoadout ( ply )
ply:StripWeapons()
ply:Give( "weapon_frag" )
ply:Give( "weapon_physcannon" )
ply:Give( "weapon_slam" )
ply:Give( "weapon_crowbar" )
ply:Give( "weapon_stunstick" )
ply:ChatPrint(ply:Nick() .. ", You have been given the Basic-Weapons.")
ply:GiveAmmo( 4, "Frag", true )
end
function GM:PlayerInitialSpawn ( ply )
self.BaseClass:PlayerInitialSpawn( ply)
ply:ChatPrint("Welcome," .. ply:Nick() .. "! Have a nice time!")
end[/lua]
You misspelled "Loadout". You had function GM:PlayerLoadOut, but it's PlayerLoad[b]o[/b]ut. Lua is case sensitive, so be careful with that.
Also, use [noparse][lua][/lua][/noparse] tags.
[lua]function GM.Initialize()
self.BaseClass.Initialize( self )
end[/lua]
Should be:
[lua]
function GM.Initialize(self) -- Or GM:Initialize()
self.BaseClass:Initialize(self)
end
[/lua]
You have some not needed whitespaces.
[QUOTE=Chessnut;35546836][lua]function GM.Initialize()
self.BaseClass.Initialize( self )
end[/lua]
Should be:
[lua]
function GM.Initialize(self) -- Or GM:Initialize()
self.BaseClass:Initialize(self)
end
[/lua]
You have some not needed whitespaces.[/QUOTE]
It doesn't matter because the lua compiler will just remove it.
Error loading gamemode: !IsValidGamemode[propkillers]
Projects Files are Here : [url]http://www.mediafire.com/?ehhm9ok573s6lcp[/url]
please help!
[editline]13th April 2012[/editline]
[QUOTE=Wizard of Ass;35542809]You should go read some articles on the wiki before asking questions.[/QUOTE]
no Good articles! i cant find any lua thing on wiki
This function is correct because it shows up correct for
[lua]function GM:PlayerLoadout ( ply )[/lua]
not
[lua]function GM:PlayerLoadOut( ply )[/lua]
although you can always put a hook.Add for a fail-safe
Why would you overwrite GM:Initialize when you call the BaseClass anyway?
Just hook it!
Also, You should define it as
[lua]function GM:Initialize()[/lua]
With a colon. Otherwise self isn't defined. Therefore BaseClass isn't called.
The reason it doesn't error is, GM.Initialize isn't called. But GM:Initialize is. (By C++).
Sorry, you need to Log In to post a reply to this thread.