Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Basic GSC Coding: Functions
#11
se aprende mucho de ti gracias x tomarte la molestia de colgar estos tutos :))))))))
Reply

#12
How can i call the Function.....i put self thread (function name); but it say bad syntax error....
Thanks.
Reply

#13
(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.
Reply

#14
(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
Reply

#15
(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();
Reply

#16
(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...
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tutorial] Basic GSC Coding: Building your first mod and your first code Yamato 2 11,234 06-07-2016, 21:49
Last Post: FrostbytePG
  [Tutorial] Basic GSC Coding: Making your second code Yamato 9 8,664 12-28-2012, 13:30
Last Post: Yamato
  [Tutorial] Basic GSC Coding: Operations Yamato 0 8,043 04-04-2012, 13:07
Last Post: Yamato
  [Tutorial] Basic GSC Coding: Foreach, Continue and Return Yamato 6 7,595 04-04-2012, 08:33
Last Post: Yamato
  [Tutorial] Basic GSC Coding: Switch Yamato 6 6,048 04-03-2012, 18:32
Last Post: tsoPANos
  [Tutorial] Basic GSC Coding: If, Else and Else If Yamato 2 5,838 03-30-2012, 10:47
Last Post: alvarogt95
  [Tutorial] Basic GSC Coding: Downloading and Installing a mod Yamato 1 5,205 03-30-2012, 10:42
Last Post: alvarogt95
  [Tutorial] Basic GSC Coding: For Yamato 4 5,939 03-26-2012, 18:39
Last Post: tsoPANos
  [Tutorial] Basic GSC Coding: While, Break and Wait Yamato 6 7,543 03-06-2012, 13:48
Last Post: Yamato

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.