Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: hahaDuNOOB i have some scripts with self and i dont know how to use self as player
i want to use this but self dont work
ModmeBot:
Reply By: Abnormal202
aahahaDuNOOB i have some scripts with self and i dont know how to use self as player i want to use this but self dont work self freezecontrols(true);
self only works when you thread a function but put an entity behind it when you thread it. for example:
will thread the function do_stuff() and with player acting as self. So when we look at the function do_stuff:
you can see we are able use self. But what self really means in this case is "player" because that's what we threaded the function with. you could always replace self with player and keep it the same function of course:
and it should work just fine.
ModmeBot:
Reply By: hahaDuNOOB
Abnormal202 aahahaDuNOOB i have some scripts with self and i dont know how to use self as player i want to use this but self dont work self freezecontrols(true); self only works when you thread a function but put an entity behind it when you thread it. for example: player thread do_stuff(); will thread the function do_stuff() and with player acting as self. So when we look at the function do_stuff: function do_stuff() { self freezecontrols(true); } you can see we are able use self. But what self really means in this case is "player" because that's what we threaded the function with. you could always replace self with player and keep it the same function of course: player freezecontrols(true); and it should work just fine.
hahaDuNOOB Abnormal202 aahahaDuNOOB i have some scripts with self and i dont know how to use self as player i want to use this but self dont work self freezecontrols(true); self only works when you thread a function but put an entity behind it when you thread it. for example: player thread do_stuff(); will thread the function do_stuff() and with player acting as self. So when we look at the function do_stuff: function do_stuff() { self freezecontrols(true); } you can see we are able use self. But what self really means in this case is "player" because that's what we threaded the function with. you could always replace self with player and keep it the same function of course: player freezecontrols(true); and it should work just fine. i put player in and get a error Line 84 player thread base_base(); ^1} ^1^ ^1ERR(6E) scripts/zm/zm_waeponsonly.gsc (84,1) : Compiler Internal Error : Uninitialized local variable 'player'
yes the problem with that is that you haven't defined player. I'm not sure what the script is you're using, but if you want to freezecontrols on all players you could use:
ModmeBot:
Reply By: hahaDuNOOB
Abnormal202 hahaDuNOOB Abnormal202 aahahaDuNOOB i have some scripts with self and i dont know how to use self as player i want to use this but self dont work self freezecontrols(true); self only works when you thread a function but put an entity behind it when you thread it. for example: player thread do_stuff(); will thread the function do_stuff() and with player acting as self. So when we look at the function do_stuff: function do_stuff() { self freezecontrols(true); } you can see we are able use self. But what self really means in this case is "player" because that's what we threaded the function with. you could always replace self with player and keep it the same function of course: player freezecontrols(true); and it should work just fine. i put player in and get a error Line 84 player thread base_base(); ^1} ^1^ ^1ERR(6E) scripts/zm/zm_waeponsonly.gsc (84,1) : Compiler Internal Error : Uninitialized local variable 'player' yes the problem with that is that you haven't defined player. I'm not sure what the script is you're using, but if you want to freezecontrols on all players you could use: foreach(player in level.players) { player freezecontrols(); }
i am working on a menü base and i menü base dont work did you know how i can get thisto work i put it in the mapname.gsc
ModmeBot:
Reply By: Abnormal202 where did you get that from? I'm not even sure that's meant for Gsc. I guess if that does what you want it to you put:
in your main(). though I really don't know what that does.
ModmeBot:
Reply By: hahaDuNOOB
Abnormal202 where did you get that from? I'm not even sure that's meant for Gsc. I guess if that does what you want it to you put: foreach(player in level.players) { player on_player_connect(); } in your main(). though I really don't know what that does.
function __init__(player in level.players) { IPrintLnBold("init reach"); player init(); player on_player_connect(); player on_player_spawned(); }
^1function __init__(player in ^1--------------------------^ ^1ERR(0) scripts/zm/zm_waeponsonly.gsc (253,27) in "__init__()" : syntax error, unexpected TOKEN_IN, expecting TOKEN_RIGHT_PAREN : function __init__(player in
ModmeBot:
Reply By: Abnormal202 I think your very first line needs a semicolon:
ModmeBot:
Reply By: hahaDuNOOB
Abnormal202 I think your very first line needs a semicolon: REGISTER_SYSTEM( "clientids", &__init__, undefined );
still the same problem the complete script
ModmeBot:
Reply By: Abnormal202 ADD THE SEMICOLON
ModmeBot:
Reply By: hahaDuNOOB
Abnormal202 ADD THE SEMICOLON
thatis not the problem i add it still dont work
ModmeBot:
Reply By: Abnormal202
hahaDuNOOB Abnormal202 ADD THE SEMICOLON thatis not the problem i add it still dont work
Add it, then give me the new error message. The old error is definitely because of the semicolon.