UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

What do i need to include to use GetPlayerName()?

broken avatar :(
Created 7 years ago
by scottyaim
0 Members and 1 Guest are viewing this topic.
3,215 views
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 17 April 2016
Last active: 6 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
scottyaim's Groups
scottyaim's Contact & Social Links
Hi, i am trying to get the name of a player but i am getting errors about GetPlayerName() being an unresolved external?

_clientids.gsc
Code Snippet
Plaintext
#using scripts\codescripts\struct;

#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM( "clientids", &__init__, undefined )

function __init__()
{
callback::on_start_gametype( &init );
callback::on_connect( &on_player_connect );
callback::on_spawned( &on_player_spawned );
callback::on_player_killed(&on_player_damaged);
}

function init()
{
level.clientid = 0;
}

function on_player_connect()
{
self.clientid = matchRecordNewPlayer( self );
if ( !isdefined( self.clientid ) || self.clientid == -1 )
{
self.clientid = level.clientid;
level.clientid++;
}
}

function on_player_spawned()
{
iPrintln("^2Fuck Em Up =)");
}

function on_player_damaged(victim, attacker)
{
self.printname = victim GetPlayerName();
iPrintLn(self.printname);
}

error:
**** 1 script error(s):
 "getplayername" with 0 parameters in "scripts/mp/gametypes/_clientids.gsc" at line 42 ****
**** Unresolved external "getplayername" with 0 parameters in "scripts/mp/gametypes/_clientids.gsc" ****

broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
GetPlayerName is a csc function, and I believe your editing a gsc, _clientids.gsc.

Code Snippet
Plaintext
void <player> GetPlayerName()

CATEGORY:
CLIENT/SERVER: Client
SUMMARY: Gets the character index
EXAMPLE: player_name = self GetPlayerName()

To get the player name in gsc try:

Code Snippet
Plaintext

if(IsPlayer(victim))
{
self.printname = victim.playername;
iPrintLn(self.printname);
}


Last Edit: January 22, 2017, 11:34:19 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 17 April 2016
Last active: 6 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
scottyaim's Groups
scottyaim's Contact & Social Links
Thanks for your reply! Man i am totally lost! Is there any kind of documentation or tutorial you can recommend to get into modding bo3?
broken avatar :(
×
broken avatar :(
Location: nzChristchurch
Date Registered: 8 June 2014
Last active: 6 years ago
Posts
77
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Can I do this?
Signature
×
IDontEvenKnow's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
http://steamcommunity.com/id/ChocolateCheese/myworkshopfiles/?section=guides

Add me if you have any questions, I'm more than willing to share the knowledge I have of scripting.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 17 April 2016
Last active: 6 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
scottyaim's Groups
scottyaim's Contact & Social Links
Thank you! I will read them when i come home. PS. Whats the difference between gsc scripts and csc script?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Thanks for your reply! Man i am totally lost! Is there any kind of documentation or tutorial you can recommend to get into modding bo3?

There is documentation in your mod tools. And there are a ton of tutorials on youtube for different things.

Here are some tutorials I made, and also at the bottom left of the page, links to some others that make tutorials, but there are many many more out there:
https://sites.google.com/site/makecentsgaming/home/bo3-tutorials


Thank you! I will read them when i come home. PS. Whats the difference between gsc scripts and csc script?

gsc is server and csc is client. That means that gsc is for everyone and csc is per player.
Last Edit: January 24, 2017, 01:41:48 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 17 April 2016
Last active: 6 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
scottyaim's Groups
scottyaim's Contact & Social Links
There is documentation in your mod tools. And there are a ton of tutorials on youtube for different things.

Here are some tutorials I made, and also at the bottom left of the page, links to some others that make tutorials, but there are many many more out there:
https://sites.google.com/site/makecentsgaming/home/bo3-tutorials


gsc is server and csc is client. That means that gsc is for everyone and csc is per player.

Ok thanks for explaining!

 
Loading ...