Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

need script to enable button on team 2 only

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

need script to enable button on team 2 only

Post by The_JOKER » Tue Sep 13, 2016 9:06 am

I need a script to make the button only visible on team 2
not for team 1...

I was wondering is it possible with script?
Last edited by The_JOKER on Tue Sep 13, 2016 1:36 pm, edited 1 time in total.
0 x

Armadyl5
Superfighter
Superfighter
Posts: 119
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 25

Post by Armadyl5 » Tue Sep 13, 2016 1:11 pm

IPlayer ply = (IPlayer)args.Sender;
if(ply.GetTeam == PlayerTeam.Team2){

These Are Enough to Make Sure Only Team2 Can Use The Button , But What do You Want The Button to do ?
1 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Tue Sep 13, 2016 1:22 pm

Armadyl5 wrote:IPlayer ply = (IPlayer)args.Sender;
if(ply.GetTeam == PlayerTeam.Team2){

These Are Enough to Make Sure Only Team2 Can Use The Button , But What do You Want The Button to do ?
I JUST MADE CS:GO MAP, And button for PLANTING BOMB XD

but i dont know everything about script, pls give full script of it (if button's script method is 'Button2')
don't forget there must be button for team1 too (for defusing bomb)
2 x

Armadyl5
Superfighter
Superfighter
Posts: 119
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 25

Post by Armadyl5 » Tue Sep 13, 2016 2:18 pm

You Didn't Answer My Question , What Does The Team 2 Button Do ??? I Can't Give You a Full Script if You Didn't Tell me What Does it Do ...
0 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Tue Sep 13, 2016 5:23 pm

Armadyl5 wrote:You Didn't Answer My Question , What Does The Team 2 Button Do ??? I Can't Give You a Full Script if You Didn't Tell me What Does it Do ...
Team 2 button does planting bomb (like counter strike) i will upload map here :)
if its not set as only for team2, team1 plants, and defuse to win...

this is the map that needs script. 'counter terrorists'
https://i.gyazo.com/71f9b7a97ed418382f7 ... 51ead3.png
https://i.gyazo.com/3ed3496a51c7afa29fe ... 3b16c6.png
1 x

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Tue Sep 13, 2016 8:38 pm

Try this, contains a template of a system to plant and defuse bombs
1 x
- Gwendalaze, failing at being fun, just like this signature

Armadyl5
Superfighter
Superfighter
Posts: 119
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 25

Post by Armadyl5 » Tue Sep 13, 2016 9:01 pm

sorry i had to go , but i see Gwendalaze Gave You What You Need .
0 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Wed Sep 14, 2016 1:19 am

thanks, but i only need button script. i already made the others. and also, bomb script you gave didn't work...
0 x

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Wed Sep 14, 2016 7:22 am

public void button2(TriggerArgs args){
IPlayer ply = (IPlayer)args.Sender;
if (ply.GetTeam() == PlayerTeam.Team2)
((IObjectTrigger)Game.GetSingleObjectByCustomId(“bomb“)).Trigger();
}
Create a script trigger named “bomb“ and put the script method of your button to “button2“. Now link as many trigger as you want to your script trigger
2 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Wed Sep 14, 2016 9:16 am

Thanks! you really helped me. Now I can finish my map :)
0 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Thu Sep 15, 2016 6:05 pm

The_JOKER wrote:I need a script to make the button only visible on team 2
not for team 1...

I was wondering is it possible with script?
No it's not possible. But see the previously answers for how to only let the button work for team 2 and not team 1.
0 x
Gurt

Locked