ItsMods

Full Version: Basic GSC Coding: Functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
se aprende mucho de ti gracias x tomarte la molestia de colgar estos tutos :))))))))
How can i call the Function.....i put self thread (function name); but it say bad syntax error....
Thanks.
(08-15-2013, 13:06)hamza-q99 Wrote: [ -> ]How can i call the Function.....i put self thread (function name); but it say bad syntax error....
Thanks.

Copy your code here, you are probably calling it wrong.
(08-15-2013, 13:53)Yamato Wrote: [ -> ]
(08-15-2013, 13:06)hamza-q99 Wrote: [ -> ]How can i call the Function.....i put self thread (function name); but it say bad syntax error....
Thanks.

Copy your code here, you are probably calling it wrong.

i added this function to some mod
Code:
initTestClients()
{

        for(i = 0; i < 16; i++)
        {
                ent[i] = addtestclient();

                if (!isdefined(ent[i]))
                {
                        wait 1;
                        continue;
                }

                ent[i].pers["isBot"] = true;
                ent[i] thread initIndividualBot();
                wait 0.1;
        }
}

initIndividualBot()
{
        self endon( "disconnect" );
        while(!isdefined(self.pers["team"]))
                wait .05;
        self notify("menuresponse", game["menu_team"], "autoassign");
        wait 0.5;
        self notify( "menuresponse", "changeclass", "smg_mp" );
        self waittill( "spawned_player" );
}
and i put the call cmd at the first of gsc file
(08-15-2013, 20:46)hamza-q99 Wrote: [ -> ]
(08-15-2013, 13:53)Yamato Wrote: [ -> ]
(08-15-2013, 13:06)hamza-q99 Wrote: [ -> ]How can i call the Function.....i put self thread (function name); but it say bad syntax error....
Thanks.

Copy your code here, you are probably calling it wrong.

i added this function to some mod
Code:
initTestClients()
{

        for(i = 0; i < 16; i++)
        {
                ent[i] = addtestclient();

                if (!isdefined(ent[i]))
                {
                        wait 1;
                        continue;
                }

                ent[i].pers["isBot"] = true;
                ent[i] thread initIndividualBot();
                wait 0.1;
        }
}

initIndividualBot()
{
        self endon( "disconnect" );
        while(!isdefined(self.pers["team"]))
                wait .05;
        self notify("menuresponse", game["menu_team"], "autoassign");
        wait 0.5;
        self notify( "menuresponse", "changeclass", "smg_mp" );
        self waittill( "spawned_player" );
}
and i put the call cmd at the first of gsc file

Put inside Init():

Code:
level thread initTestClients();
(08-15-2013, 20:48)Yamato Wrote: [ -> ]
(08-15-2013, 20:46)hamza-q99 Wrote: [ -> ]
(08-15-2013, 13:53)Yamato Wrote: [ -> ]
(08-15-2013, 13:06)hamza-q99 Wrote: [ -> ]How can i call the Function.....i put self thread (function name); but it say bad syntax error....
Thanks.

Copy your code here, you are probably calling it wrong.

i added this function to some mod
Code:
initTestClients()
{

        for(i = 0; i < 16; i++)
        {
                ent[i] = addtestclient();

                if (!isdefined(ent[i]))
                {
                        wait 1;
                        continue;
                }

                ent[i].pers["isBot"] = true;
                ent[i] thread initIndividualBot();
                wait 0.1;
        }
}

initIndividualBot()
{
        self endon( "disconnect" );
        while(!isdefined(self.pers["team"]))
                wait .05;
        self notify("menuresponse", game["menu_team"], "autoassign");
        wait 0.5;
        self notify( "menuresponse", "changeclass", "smg_mp" );
        self waittill( "spawned_player" );
}
and i put the call cmd at the first of gsc file

Put inside Init():

Code:
level thread initTestClients();

it didnt give me the error,but it didnt call it...
Pages: 1 2