Post: Help me with some syntax.
02-24-2011, 04:43 PM #1
xQuZe-
You talkin to me?
(adsbygoogle = window.adsbygoogle || []).push({}); Look i want diffrent things to happen if i press a button. How am i going to code it? Help plzz. I've got something really cool.

    			{
self waittill("button_cross");

{
//Domods
}
}
else
{
self waittill("button_square");

{
//Domods
}
}


Like this. Please help!
(adsbygoogle = window.adsbygoogle || []).push({});
02-24-2011, 10:28 PM #2
xPwn
Error… Cat invasion!
{
//Domods
}
}

????? // = comment

so it iwll ignore that

so it will see:

{}}
02-25-2011, 12:50 AM #3
Originally posted by xQuZe
Look i want diffrent things to happen if i press a button. How am i going to code it? Help plzz. I've got something really cool.

    			{
self waittill("button_cross");

{
//Domods
}
}
else
{
self waittill("button_square");

{
//Domods
}
}


Like this. Please help!


You're probably better off using, (switch), "case" and "break" selectors.

Look in Mossys V2 or TheUnkn0wns patches for examples of usage..

The following user thanked x_DaftVader_x for this useful post:

xQuZe-
02-25-2011, 06:34 AM #4
xQuZe-
You talkin to me?
Originally posted by ..V.. View Post
You're probably better off using, (switch), "case" and "break" selectors.

Look in Mossys V2 or TheUnkn0wns patches for examples of usage..


Okay thanks Happy
02-25-2011, 01:33 PM #5
xQuZe-
You talkin to me?
Originally posted by ..V.. View Post
You're probably better off using, (switch), "case" and "break" selectors.

Look in Mossys V2 or TheUnkn0wns patches for examples of usage..


The code works but how do i get it so it destroys text and shows new text when i press reload. and other new text when i press frag.
    
self.quze=self createFontString("objective",1.6);
self.quze setPoint("CENTER","CENTER", 10);
self.quze setText("Text");
{
self waittill("buttonPress", button);
switch(button)
{
case "Up":
break;
case "Down":
break;
case "Left":
break;
case "Right":
break;
case "A":
break;
case "B":
self.quze destroy();
wait 1;
do=self createFontString("objective",1.6);
do setPoint("CENTER","CENTER", 10);
do setText("NewText");
break;
case "X":
break;
default:
break;
}


}
02-25-2011, 03:07 PM #6
Default Avatar
Gizmo
Guest
Originally posted by xQuZe
The code works but how do i get it so it destroys text and shows new text when i press reload. and other new text when i press frag.
    
self.quze=self createFontString("objective",1.6);
self.quze setPoint("CENTER","CENTER", 10);
self.quze setText("Text");
{
self waittill("buttonPress", button);
switch(button)
{
case "Up":
break;
case "Down":
break;
case "Left":
break;
case "Right":
break;
case "A":
break;
case "B":
self.quze destroy();
wait 1;
do=self createFontString("objective",1.6);
do setPoint("CENTER","CENTER", 10);
do setText("NewText");
break;
case "X":
break;
default:
break;
}


}


Are you just trying to Bind buttons to do certain threads ?
You can use this, but it will take up a bit more room than the one Daft Suggested.
    
name what you want()
{
self endon( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );

for(;Winky Winky
self waittill( "dpad_up" );
{
//Mods here
}
}


Im not sure, but I think you can do it like this
    

name what you want()
{
self endon( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );

for(;Winky Winky

self waittill( "dpad_up" );
{
//Mods here
}

self waittill( "dpad_down" );
{
//mods here
}
}
02-25-2011, 03:09 PM #7
xQuZe-
You talkin to me?
Originally posted by 95 View Post
Are you just trying to Bind buttons to do certain threads ?
You can use this, but it will take up a bit more room than the one Daft Suggested.
    
name what you want()
{
self endon( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );

for(;Winky Winky
self waittill( "dpad_up" );
{
//Mods here
}
}


Im not sure, but I think you can do it like this
    

name what you want()
{
self endon( "disconnect" );
self endon( "death" );
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );

for(;Winky Winky

self waittill( "dpad_up" );
{
//Mods here
}

self waittill( "dpad_down" );
{
//mods here
}
}


Nope that's what i tried first.
It only does the dpad_up bind and not the dpad_down.
So I mean it only work's for the first mod.
Btw mah 200th post ;-0
02-25-2011, 03:15 PM #8
Default Avatar
Gizmo
Guest
Originally posted by xQuZe
Nope that's what i tried first.
It only does the dpad_up bind and not the dpad_down.
So I mean it only work's for the first mod.
Btw mah 200th post ;-0


Just make a separate thread for each bind then, It will take up quite a bit of room though :/
02-25-2011, 03:45 PM #9
xQuZe-
You talkin to me?
Originally posted by 95 View Post
Just make a separate thread for each bind then, It will take up quite a bit of room though :/


Then my shit aint working Winky Winky
Thx for trying to help.
02-25-2011, 05:42 PM #10
Originally posted by xQuZe
The code works but how do i get it so it destroys text and shows new text when i press reload. and other new text when i press frag.
    
self.quze=self createFontString("objective",1.6);
self.quze setPoint("CENTER","CENTER", 10);
self.quze setText("Text");
{
self waittill("buttonPress", button);
switch(button)
{
case "Up":
break;
case "Down":
break;
case "Left":
break;
case "Right":
break;
case "A":
break;
case "B":
self.quze destroy();
wait 1;
do=self createFontString("objective",1.6);
do setPoint("CENTER","CENTER", 10);
do setText("NewText");
break;
case "X":
break;
default:
break;
}


}


You need to add another function along the lines of

DestroyText(text){
for(;; ){
self waittill "reload";
text Destroy();}}

Thats not a proper function but you get the idea...

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo