Ergebnis 1 bis 6 von 6

Thema: Wie Movement Typ ändern und ein paar weitere Fragen...

  1. #1

    Standard Wie Movement Typ ändern und ein paar weitere Fragen...

    (bin mir nicht sicher obs hierrein gehört)

    Ich suche seit ner stunde den Befehl um vom Player den Movement Typ zu ändern. Gefunden habe ich bisher nichts. Wie heißt dieser?

    (für den ders wissen will... ich bau mir nen eigenen gamemode. zum üben derzeit)
    Geändert von CGamer (14.04.2009 um 17:47 Uhr) Grund: gefunden... wieso hidet man befehle so stark?

  2. #2

    Standard AW: Wie Movement Typ ändern und ein paar weitere Fragen...

    Wir haben ne extra Kategorie für Lua, steht sogar "Lua" dran

    Hier ist ne Übersicht aller Funktionen:
    http://wiki.garrysmod.com/wiki/?titl...:Lua_functions

    Und das was du suchst nennt sich: Entity.SetMoveType

    Entity deshalb weil der Spieler ja auch ein Entity ist.

  3. #3

    Standard AW: Wie Movement Typ ändern und ein paar weitere Fragen...

    danke funktioniert leider nicht:/

    cl_init.lua
    Lua Code:
    1. include("shared.lua")
    2.  
    3. function UpdateTeam()
    4. 	local frame
    5. 	frame = vgui.Create( "DFrame" )
    6. 	frame:SetPos( ScrH() / 2, ScrW() / 2 )	//Create Teamchange Window
    7. 	frame:SetSize( 200, 140 ) //Set the size
    8. 	frame:SetTitle( "Select Mode" )
    9. 	frame:SetVisible( true )
    10. 	frame:SetDraggable( false )
    11. 	frame:ShowCloseButton( true )
    12. 	frame:MakePopup()
    13.  
    14. 	but_spec = vgui.Create( "DButton", frame )
    15. 	but_spec:SetPos( 10, 10 )
    16. 	but_spec:SetSize( 180, 55 )
    17. 	but_spec:SetText( "Spectate" )
    18. 	but_spec.DoClick = function()
    19. 		RunConsoleCommand( "ghidden_spectator" )
    20. 	end
    21.  
    22. 	but_hidd = vgui.Create( "DButton", frame )
    23. 	but_hidd:SetPos( 10, 70 )
    24. 	but_hidd:SetSize( 180, 55 )
    25. 	but_hidd:SetText( "Playing" )
    26. 	but_hidd.DoClick = function()
    27. 		RunConsoleCommand( "ghidden_hunter" )
    28. 	end 
    29. end 
    30. concommand.Add( "ghidden_team", UpdateTeam )

    init.lua
    Lua Code:
    1. AddCSLuaFile( "cl_init.lua" ) //Tell the server that the client needs to download cl_init.lua
    2. AddCSLuaFile( "shared.lua" ) //Tell the server that the client needs to download shared.lua
    3.  
    4. include( 'shared.lua' ) //Tell the server to load shared.lua
    5.  
    6. function GM:PlayerIntitialSpawn( ply )
    7. 	ply:SetTeam( 1 )		//Join Team Spectators
    8. 	ply:ConCommand( "ghidden_team" )
    9. 	ply:ChatPrint( "[GHidden]Welcome to the Server, " .. ply:Nick() )
    10. 	ply:CrosshairDisable()
    11. end 
    12.  
    13. function GM:PlayerLoadout( ply )
    14. 	if ply:Team() == 1 then
    15. 		ply:Spectate( 6 )
    16. 		ply:SetMoveType( MOVETYPE_OBSERVER )
    17. 	elseif ply:Team() == 2 then
    18. 		//Weapons
    19. 		ply:Give( "weapon_phycannon" )
    20. 		ply:Give( "weapon_knife" )
    21.  
    22. 		//Ammo
    23.  
    24. 		//Model
    25. 		ply:SetModel( "models/player/kleiner.mdl" )
    26. 		ply:SetColor(  255, 255, 255, 22.5 )
    27.  
    28. 		//Data
    29. 		ply:SetMaxHealth( 250 )
    30. 		ply:SetHealth( 250 )
    31. 		ply:SetArmor( 0 )
    32.  
    33. 		//Physics
    34. 		ply:SetMoveSpeed( 350 )
    35. 		ply:SetGravity( 0.75 )
    36. 		ply:SetJumpPower( 320 )
    37. 		ply:SetMoveType( MOVETYPE_WALK )
    38. 	elseif ply:Team() == 3 then
    39. 		//Weapons
    40. 		ply:Give( "weapon_pistol" )
    41. 		ply:Give( "weapon_357" )
    42. 		ply:Give( "weapon_ar2" )
    43.  
    44. 		//Ammo
    45. 		ply:GiveAmmo( 60, "pistol" )
    46. 		ply:GiveAmmo( 12, "357" )
    47. 		ply:GiveAmmo( 60, "ar2" )
    48.  
    49. 		//Model
    50. 		ply:SetModel( "models/player/barney.mdl" )
    51.  
    52. 		//Data
    53. 		ply:SetMaxHealth( 100 )
    54. 		ply:SetArmor( 100 )
    55.  
    56. 		//Physics
    57. 		ply:SetMoveSpeed( 250 )
    58. 		ply:SetGravity( 1 )
    59. 		ply:SetJumpPower( 160 )
    60. 		ply:SetMoveType( MOVETYPE_WALK )
    61. 	end 
    62. 	ply:Spawn()
    63. end 
    64.  
    65. // Custom Functions(Team)
    66. function team_spec( ply )
    67. 	ply:SetTeam( 1 )
    68. 	ply:Kill()
    69.  
    70. 	ply:Spectate( 6 )
    71. 	ply:SetMoveType( MOVETYPE_OBSERVER )
    72.  
    73. 	ply:ChatPrint( "Joined Team " .. Team.GetName( 3 ) )
    74.  
    75. 	ply:Spawn()
    76. end 
    77.  
    78. function team_playing( ply )
    79. 	ply:SetTeam( 3 )
    80. 	ply:Kill()
    81. 	ply:ChatPrint( "" )
    82. end
    83.  
    84. //ConCommands
    85. concommand.Add( "ghidden_spectator", team_spec )
    86. concommand.Add( "ghidden_hunter", team_playing )

    shared.lua
    Lua Code:
    1. GM.Name = "Hidden: GMod" //Set the gamemode name
    2. GM.Author = "perfectdeath545" //Set the author name
    3. GM.Email = "[email protected]" //Set the author email
    4. GM.Website = "http://ssgn.net63.net/" //Set the author website
    5.  
    6. team.SetUp( 1, "Spectator", color(127, 127, 127, 255) )
    7. team.SetUp( 2, "Hidden", color(255, 0, 0, 255) )
    8. team.SetUp( 3, "S.W.A.T.", color(204, 204, 204, 255) )
    9.  
    10. function GetAliveCount()
    11. 	local Count = 0
    12. 	for k, v in Player:GetAll() do
    13. 		if v.Alive() == true then
    14. 			Count = Count + 1
    15. 		end 
    16. 	end 
    17. 	return Count
    18. end 
    19.  
    20. function GetPlayerCount()
    21. 	local Count = 0
    22. 	for k, v in Player:GetAll() do
    23. 		Count = Count + 1
    24. 	end
    25. 	return Count
    26. end

    Ich denke man kann erkennen das ich nen gmod gamemode von The Hidden: Source machen möchte

  4. #4

    Standard AW: Wie Movement Typ ändern und ein paar weitere Fragen...

    Irgendwelche Fehler?

  5. #5

    Standard AW: Wie Movement Typ ändern und ein paar weitere Fragen...

    ja C Stack Overflow und Unknown command(oder so) :SetMoveType

    [edit] diese c stack overflow:
    ERROR: GAMEMODE:'PlayerSelectSpawn' Failed: includes\util.lua:9: C stack overflow
    ERROR: GAMEMODE:'SetPlayerAnimation' Failed: base\gamemode\player.lua:15: C stack overflow
    ERROR: GAMEMODE:'PlayerSpawn' Failed: base\gamemode\player.lua:377: C stack overflow
    Geändert von CGamer (14.04.2009 um 22:09 Uhr)

  6. #6

    Standard AW: Wie Movement Typ ändern und ein paar weitere Fragen...

    Mach das ply:Spawn() aus den Loadout raus.
    Was hat das denn da verloren,schließlich willst du den Spieler ja nicht nochmal spawnen wenn er gerade Spawnt.

  7. Folgender Benutzer sagt Danke zu BennyG für den nützlichen Beitrag:


Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •