Serious Roleplaying Hell
  • Search
  • Leaderboard
  • Member List
  • Help
  • Donate
  • Portal

Register


Serious Roleplaying Hell General General Discussion v
« Previous 1 ... 34 35 36 37 38 ... 58 Next »
Need help for my Gamemode

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Need help for my Gamemode
11-16-2012, 08:10 PM
Post: #1
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
Question Need help for my Gamemode
Hi,

I'm making a gamemode for an event.

And my gamemode won't work so I need you to help me fix it.

My Gamemode :
https://dl.dropbox.com/u/42061161/Garry%27sRace.rar

Thanks if you can help me.

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 08:15 PM
Post: #2
Phoenix Online
Elder | Stranded Manager
*****
Joined: Jun 2011
SteamID: STEAM_0:1:15215139
Coder
RE: Need help for my Gamemode
Code:
function CheckSpecialCharacters( ply ) //This function is called upon on GM:PlayerInitialSpawn


//Here we add our characters which are special.
//I left an example with what I have

    --_FR_Starfox64
    if ( ply:SteamID() == "STEAM_0:1:37636871" ) then //If steamid is that, then execute the following

        ply:PrintMessage( HUD_PRINTTALK, "Salut, " .. ply:Nick() .. "\nTon IP: " .. ply:IPAddress() ) // Gives the message
        //Welcome back Darkcha0s, you have connected under the IP: blah. In local multiplayer it will be loopback.
        ply:SetTeam( 3 ) //Set it to this team, look in shared.lua for this one.
        // He should recieve the following weapons
        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 this if
    //For other characters, use elseif for example
    // elseif (ply:SteamID() == "STEAM 02984529" ) then
    //ply:SetTeam( 2 )
    //etc. etc.
end //end the function

yeaaaah no.
there's a lot of mistakes, i'll edit this post when i fix them.

[Image: b_560_95_1.png]

Stranded To-Do List
Stranded Request / Bug Form
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 08:18 PM
Post: #3
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
RE: Need help for my Gamemode
Thanks

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 08:30 PM
Post: #4
Phoenix Online
Elder | Stranded Manager
*****
Joined: Jun 2011
SteamID: STEAM_0:1:15215139
Coder
RE: Need help for my Gamemode
try this:

http://puu.sh/1qTMl

please log any errors and give them to me, if possible.

[Image: b_560_95_1.png]

Stranded To-Do List
Stranded Request / Bug Form
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 08:40 PM
Post: #5
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
RE: Need help for my Gamemode
Little question, since I don't see it on the main menu, how do I run it ?

I do changelevel gm_construct Garry's Race

and it don't work...

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 08:43 PM
Post: #6
Residualgrub Online
503 Service Unavailable
**
Joined: Jan 2012
SteamID: STEAM_0:1:32676154
UpriserTHE VOICE OF GODArtistic
RE: Need help for my Gamemode
Why are you using a specific steam id shouldn't you log the id then have it check if they have joined before?


My Tumblr | My Youtube

Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 08:51 PM
Post: #7
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
RE: Need help for my Gamemode
(11-16-2012 08:43 PM)Residualgrub Wrote:  Why are you using a specific steam id shouldn't you log the id then have it check if they have joined before?

It's just for the admins, if he's ID is BLABLABLA he join the Team 2 and get the weps.

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 09:00 PM
Post: #8
Residualgrub Online
503 Service Unavailable
**
Joined: Jan 2012
SteamID: STEAM_0:1:32676154
UpriserTHE VOICE OF GODArtistic
RE: Need help for my Gamemode
(11-16-2012 08:51 PM)_FR_Starfox64 Wrote:  
(11-16-2012 08:43 PM)Residualgrub Wrote:  Why are you using a specific steam id shouldn't you log the id then have it check if they have joined before?

It's just for the admins, if he's ID is BLABLABLA he join the Team 2 and get the weps.
Ah ok that makes sense


My Tumblr | My Youtube

Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 09:01 PM (This post was last modified: 11-16-2012 09:02 PM by Phoenix.)
Post: #9
Phoenix Online
Elder | Stranded Manager
*****
Joined: Jun 2011
SteamID: STEAM_0:1:15215139
Coder
RE: Need help for my Gamemode
the LUA file was scripted to join team 3, i'm assuming this is wrong, unless you changed it.
other than that, wouldn't it be more effective to use ply:IsAdmin()
i'm not quite sure of your intentions.

[Image: b_560_95_1.png]

Stranded To-Do List
Stranded Request / Bug Form
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2012, 09:14 PM (This post was last modified: 11-16-2012 09:24 PM by _FR_Starfox64.)
Post: #10
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
RE: Need help for my Gamemode
(11-16-2012 09:01 PM)Phoenix Wrote:  the LUA file was scripted to join team 3, i'm assuming this is wrong, unless you changed it.
other than that, wouldn't it be more effective to use ply:IsAdmin()
i'm not quite sure of your intentions.

I will not use any admin mod so I can't put an admin list somewhere so I used this.

And can you tell me how to run it like I said...
(11-16-2012 09:01 PM)Phoenix Wrote:  the LUA file was scripted to join team 3, i'm assuming this is wrong, unless you changed it.
other than that, wouldn't it be more effective to use ply:IsAdmin()
i'm not quite sure of your intentions.

This will be like a whitelist so only them will be able to join the team then I will just have to remove the Button/Command to join the Team 2 (Admin)

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2012, 01:47 AM
Post: #11
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
Question RE: Need help for my Gamemode
A huge thanks to Phoenix who helped me a lot (But removed the specialchars.lua, I just let it on the menu cause the gamemode is for a private server so I don't care)

I have a question, How I can only allow the team_2 from no-cliping and using spawn menu ?

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2012, 02:00 AM (This post was last modified: 11-17-2012 02:00 AM by Rodrigo 4Ever.)
Post: #12
Rodrigo 4Ever Offline
Elder
*****
Joined: Jun 2010
SteamID: STEAM_0:0:14765219
CoderTop Poster
RE: Need help for my Gamemode
(11-17-2012 01:47 AM)_FR_Starfox64 Wrote:  I have a question, How I can only allow the team_2 from no-cliping and using spawn menu ?

Code:
hook.Add("PlayerNoClip", "Team2Noclip", function( ply )

    if ply:Team() == 2 then

        return true

    else

        return false

    end

end)

Drakehawke: i was going to ask whether i should wank to straight or gay porn today
Find all posts by this user
Quote this message in a reply
11-17-2012, 02:07 AM
Post: #13
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
RE: Need help for my Gamemode
(11-17-2012 02:00 AM)Rodrigo 4Ever Wrote:  
(11-17-2012 01:47 AM)_FR_Starfox64 Wrote:  I have a question, How I can only allow the team_2 from no-cliping and using spawn menu ?

Code:
hook.Add("PlayerNoClip", "Team2Noclip", function( ply )

    if ply:Team() == 2 then

        return true

    else

        return false

    end

end)

Thanks but can you block them from showing the spawn menu too ?

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2012, 04:07 AM (This post was last modified: 11-17-2012 04:08 AM by Rodrigo 4Ever.)
Post: #14
Rodrigo 4Ever Offline
Elder
*****
Joined: Jun 2010
SteamID: STEAM_0:0:14765219
CoderTop Poster
RE: Need help for my Gamemode
Seriously, stop what you are doing because you clearly lack any and all knowledge in lua, start doing something smaller, don't jump in the wagon of gamemodes straight off without any knowledge. But if you insist, try looking at the gmod wiki, seriously...

the code below is CLIENT SIDE ONLY
Code:
hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", function( ply )

    if ply:Team() == 2 then

        return true

    else

        return false

    end

end)

Drakehawke: i was going to ask whether i should wank to straight or gay porn today
Find all posts by this user
Quote this message in a reply
11-17-2012, 09:40 AM (This post was last modified: 11-17-2012 09:41 AM by _FR_Starfox64.)
Post: #15
_FR_Starfox64 Offline
SRH's Official French Guy™
**
Joined: May 2012
SteamID: STEAM_0:1:37636871
RE: Need help for my Gamemode
Calm down,
I found the right way for the props, I just made Players unable to spawn props like this :
Code:
function SpawnedProp(ply, model, ent)
    if ply:Team() == 1 then
        ent:Remove()
    end
end

hook.Add("PlayerSpawnedProp", "playerSpawnedProp", SpawnedProp)

And I used this in shared.lua for the noclip :
Code:
local function DisableNoclip( Ply )
    return Ply:Team() == 2
end
hook.Add("PlayerNoClip", "DisableNoclip", DisableNoclip)

[Image: Signature%20_FR_Starfox64.jpg]
[Image: _fr_starfox64.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2012, 10:51 AM
Post: #16
Phoenix Online
Elder | Stranded Manager
*****
Joined: Jun 2011
SteamID: STEAM_0:1:15215139
Coder
RE: Need help for my Gamemode
the fact is, we're not going to spoon feed you information, the way I learned was firstly looking at the old GMod LUA Tutorials, that way I got the overall basis of LUA's structure. then I experimented, used the wiki hundreds of times, then realized I was actually learning something.

now look where I am, I can actually code fairly above-normal scripts and a simple HUD provided I can access the wiki at 'some' times, though I am actually starting to stop using the wiki as I know what to do now.

tl;dr: we won't keep helping you, use the wiki and experiment yourself.

[Image: b_560_95_1.png]

Stranded To-Do List
Stranded Request / Bug Form
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2012, 02:34 PM
Post: #17
Rodrigo 4Ever Offline
Elder
*****
Joined: Jun 2010
SteamID: STEAM_0:0:14765219
CoderTop Poster
RE: Need help for my Gamemode
(11-17-2012 10:51 AM)Phoenix Wrote:  the fact is, we're not going to spoon feed you information, the way I learned was firstly looking at the old GMod LUA Tutorials, that way I got the overall basis of LUA's structure. then I experimented, used the wiki hundreds of times, then realized I was actually learning something.

now look where I am, I can actually code fairly above-normal scripts and a simple HUD provided I can access the wiki at 'some' times, though I am actually starting to stop using the wiki as I know what to do now.

tl;dr: we won't keep helping you, use the wiki and experiment yourself.

You never are going to stop using the Wiki, doubtfully you are going to remember all functions, their parameters and exceptions for stuff. The wiki is made for that, even the most pro coders use the wiki for the functions, maybe even for some examples, but mainly for the function documentation.

Drakehawke: i was going to ask whether i should wank to straight or gay porn today
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact UsSerious Roleplaying HellReturn to TopReturn to ContentLite (Archive) ModeRSS SyndicationPowered by Steam

Powered By MyBB, © 2002-2013 MyBB Group.
Theme by Ryan McGrane of Audentio Design.