So I'm trying to figure out how to make a custom command for darkrp that basically makes the player say "/me pulls out their id and shows it. On the id it displays [rpname], and [rpjob]." I know for most lua coders that this is simple but I don't know how to make it so that it references to the players job, to the command /me, and to the players name.
[url]https://wiki.garrysmod.com/page/GM/PlayerSay[/url]
[url]https://wiki.garrysmod.com/page/Global/RunConsoleCommand[/url]
[url]https://wiki.garrysmod.com/page/team/GetName[/url] (job name)
[url]http://wiki.garrysmod.com/page/Player/Nick[/url]
there, there's enough examples in those pages already. check them out. don't expect people to do this for you.
If you haven't found out yet.
local function ShowID(ply, args)
PrintMessage( HUD_PRINTTALK, "Information: " .. ply:Nick() .. ", " .. team.GetName(ply:Team()) )
end
AddChatCommand("/showid", ShowID)
AddChatCommand is DarkRP 2.4.3 I assume if it's 2.5 or above, you use
DarkRP.defineChatCommand("showid", ShowId) instead
[QUOTE=D3NNYM41C01M;49271349]If you haven't found out yet.
local function ShowID(ply, args)
PrintMessage( HUD_PRINTTALK, "Information: " .. ply:Nick() .. ", " .. team.GetName(ply:Team()) )
end
AddChatCommand("/showid", ShowID)
AddChatCommand is DarkRP 2.4.3 I assume if it's 2.5 or above, you use
DarkRP.defineChatCommand("showid", ShowId) instead[/QUOTE]
False, that'd only print the text to the user, he wants it like the HL2RP "/appy" function thats like "John Doe, Citizen, -randomly generated UID from a different addon IF wanted-."
But what if there are more than one players on the server with the same nickname?
[QUOTE=MPan1;49277485]But what if there are more than one players on the server with the same nickname?[/QUOTE]
Source games automaticly put (n) behind the 2nd+ nickname if its a duplicate. -- plus it only prints it to the player itself, since its the ply object.
[QUOTE=whitestar;49271672]False, that'd only print the text to the user, he wants it like the HL2RP "/appy" function thats like "John Doe, Citizen, -randomly generated UID from a different addon IF wanted-."[/QUOTE]
"Information: " .. ply:Nick() .. ", " .. team.GetName(ply:Team()) ) Is printed out like
Information : D3Gaming, Citizen
He can change Information to ID or UserID, ect ect. And I've never played HL2RP. So he's gotta be more descriptive.
Dont use UID, plus it doesnt REALLY need an ID hence "-randomly generated UID from a different addon [B][U]IF[/U][/B] wanted-"
Sorry, you need to Log In to post a reply to this thread.