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.
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
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?
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
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!