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

A lot of things in the official Treyarch documentation don't actually work

broken avatar :(
Created 8 years ago
by wumbi
0 Members and 1 Guest are viewing this topic.
3,306 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2016
Last active: 6 years ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
wumbi's Groups
wumbi's Contact & Social Links
For example, using GetLocalPlayer( 0 ); does not work, the game starts but then shows an error saying the following:

****1 script error(s):
"getlocalplayer" with 1 parameters in "scripts/zm/zm_test.gsc" at line 122****
****Unresolved external "getlocalplayer" with 1 parameters in "scripts/zm/zm_test.gsc"****

Another example is the usage of the variable "player". Treyarch gives this example to disable aim assist on an entity:
player DisableAimAssist();
But when putting this exact code in my script, I get this error in the compiler:
^1ERR(6E) scripts/zm/zm_test.gsc (122,0)  : Compiler Internal Error :  Uninitialized local variable 'player'

Honestly I'm probably just being stupid, but help is appreciated! Maybe I'll be able to figure out (most likely) simple things like this in the future by myself.
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Getlocalplayer is a csc function... Not a gsc

And player is just a variable example. You need to define what player is before referring to it...

I'd suggest you re-read the basics
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2016
Last active: 6 years ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
wumbi's Groups
wumbi's Contact & Social Links
Getlocalplayer is a csc function... Not a gsc

And player is just a variable example. You need to define what player is before referring to it...

I'd suggest you re-read the basics
I'm sorry, I'm very new to this. I can't seem to find any tutorials anywhere so I'm just going off of my knowledge of C++. Could you point me in the right direction?
Marked as best answer by wumbi 8 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
I'm sorry, I'm very new to this. I can't seem to find any tutorials anywhere so I'm just going off of my knowledge of C++. Could you point me in the right direction?

A good example of what he is talking about is a trigger:
Code Snippet
Plaintext
// This is just an example, don't use it if you aren't using a trigger
function init()
{
    trig = GetEnt("test_trigger", "targetname");

    trig waittill("trigger", player)// Player is defined here, which makes it equal to the player that triggered "test_trigger"

    player DisableAimAssist();
}

You could also do this:
Code Snippet
Plaintext
function init()
{
    players = GetPlayers();
    // Players is defined here, making it into a variable with all players in it which can be accessed for whatever you need. Each player in players will act the same as a player defined from a trigger

    for(i=0; i < players.size; i++)
   {
         // This will disable aim assist for everyone, can also be applied to other things such as giving a weapon to every player.
        players[i] DisableAimAssist();
   }
}

gsc is based off of C so if you have knowledge in C++ this will be the same if not much easier since there is no form of memory management or anything like that. Basically just simplified C/C++.
Last Edit: October 07, 2016, 12:15:09 pm by reckfullies
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 August 2016
Last active: 6 years ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
wumbi's Groups
wumbi's Contact & Social Links
A good example of what he is talking about is a trigger:
Code Snippet
Plaintext
// This is just an example, don't use it if you aren't using a trigger
function init()
{
    trig = GetEnt("test_trigger", "targetname");

    trig waittill("trigger", player)// Player is defined here, which makes it equal to the player that triggered "test_trigger"

    player DisableAimAssist();
}

You could also do this:
Code Snippet
Plaintext
function init()
{
    players = GetPlayers();
    // Players is defined here, making it into a variable with all players in it which can be accessed for whatever you need. Each player in players will act the same as a player defined from a trigger

    for(i=0; i < players.size; i++)
   {
         // This will disable aim assist for everyone, can also be applied to other things such as giving a weapon to every player.
        players[i] DisableAimAssist();
   }
}

gsc is based off of C so if you have knowledge in C++ this will be the same if not much easier since there is no form of memory management or anything like that. Basically just simplified C/C++.
I feel so stupid now that the answer is in front of me. Thank you!

 
Loading ...