UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Double PointS

broken avatar :(
Created 12 years ago
by pashan
0 Members and 1 Guest are viewing this topic.
4,448 views
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
How would i give the player double points power up if they hit a trigger?
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 29 August 2012
Last active: 8 years ago
Posts
366
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
haxman123's Groups
haxman123's Contact & Social Links
Make a new .gsc and call it buy_powerup.gsc

than insert this

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_utility;
main()
{
  powerup_trigs = getentarray( "buy_powerup", "targetname" );
  array_thread( powerup_trigs,::buy_powerup );
}
buy_powerup()
{
  while(1)
  {
     player = undefined;
     powerup_name = undefined;
     cost = 1000;
     powerup = self.script_noteworthy;
     self UseTriggerRequireLookAt();
     if( powerup == "insta_kill" )
     {
        powerup_name = "Insta Kill";
        cost = 2000;
     }
     else if( powerup == "double_points" )
     {
        powerup_name = "Double Points";
        cost = 1000;
     }
     else if( powerup == "max_ammo" )
     {
        powerup_name = "Max Ammo";
        cost = 1000;
     }
      self SetHintString( "Press &&1 to buy  " + powerup_name + " Powerup [Cost: "+cost+"]" );
      self waittill( "trigger", player );
      if( !is_player_valid( player ) )
     {
        continue;
     }
     if( player.score >= cost )
     {
        player playsound( "cha_ching" );
        player maps\_zombiemode_score::minus_to_player_score( cost );
            if( powerup == "insta_kill" )
        {
           maps\_zombiemode_powerups::insta_kill_powerup();
        }
        else if( powerup == "double_points" )
        {
           maps\_zombiemode_powerups::double_points_powerup();
        }
        else if( powerup == "max_ammo" )
        {
           maps\_zombiemode_powerups::full_ammo_powerup();
        }
     }
     else
     {
        player playsound( "no_cha_ching" );
     }
     wait(30);
  }
}


put this mods mapname maps
Than open radiant and your map. Am sure you don't need a screenshot for this bit ;-) This part is for double points create a trigger use where u want the trigger to be and give the kvps of
script_noteworthy double_points

Code Snippet
Plaintext
 targetname:   buy_powerup



than after that choose a model with you want your trigger to be next to i have chosen zombie_x2_icon now put the trigger and model together


broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Thanks for you effort haxman123 but i just wanted a little block of code. (Not buyable double points.

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
switch sethintstring("");
switch setCursorHInt( "HINT_NOICON" );
for( i = 0; i < switch.size; i++ )
switch[i] thread trigger();
        Play = GetPlayers();
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}



trigger()
{
self waittill( "trigger" );
level.TeddyCount += 1;
iprintln("Beep!!!");


}

It was suppose to be an easter egg
broken avatar :(
×
broken avatar :(
Location: england
Date Registered: 29 August 2012
Last active: 8 years ago
Posts
366
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
haxman123's Groups
haxman123's Contact & Social Links
Thanks for you effort haxman123 but i just wanted a little block of code. (Not buyable double points.

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
switch sethintstring("");
switch setCursorHInt( "HINT_NOICON" );
for( i = 0; i < switch.size; i++ )
switch[i] thread trigger();
        Play = GetPlayers();
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}



trigger()
{
self waittill( "trigger" );
level.TeddyCount += 1;
iprintln("Beep!!!");


}

It was suppose to be an easter egg

No problem dude thats fine :D
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
uh.... could anyone give me a little block of code for double points which could fit in this script?

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
switch sethintstring("");
switch setCursorHInt( "HINT_NOICON" );
for( i = 0; i < switch.size; i++ )
switch[i] thread trigger();
        Play = GetPlayers();
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}



trigger()
{
self waittill( "trigger" );
level.TeddyCount += 1;
iprintln("Beep!!!");


}
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
uh.... could anyone give me a little block of code for double points which could fit in this script?

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
switch sethintstring("");
switch setCursorHInt( "HINT_NOICON" );
for( i = 0; i < switch.size; i++ )
switch[i] thread trigger();
        Play = GetPlayers();
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}



trigger()
{
self waittill( "trigger" );
level.TeddyCount += 1;
iprintln("Beep!!!");


}

couldnt you use this?
Code Snippet
Plaintext
 maps\_zombiemode_powerups::double_points_powerup();

I used that from the code that haxman posted, in the double points part of the script
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Got a bad syntax on line 8

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
switch sethintstring("");
switch setCursorHInt( "HINT_NOICON" );
for( i = 0; i < switch.size; i++ )
switch[i] thread trigger();
        Play = GetPlayers();
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}



trigger()
{
self waittill( "trigger" );
level.TeddyCount += 1;
iprintln("Beep!!!");


}
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Got a bad syntax on line 8

Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
switch sethintstring("");
switch setCursorHInt( "HINT_NOICON" );
for( i = 0; i < switch.size; i++ )
switch[i] thread trigger();
        Play = GetPlayers();
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}



trigger()
{
self waittill( "trigger" );
level.TeddyCount += 1;
iprintln("Beep!!!");


}

did you use my line i gave you? if you did where did you put it
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
i used the line u gave me and put it where it says //double point give code goes here
Last Edit: May 27, 2014, 02:57:48 am by pashan
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
i just tried your script without my line and still got the bad syntax, so theres something wrong with your code before my line. line 8 says
Code Snippet
Plaintext
switch = GetEntArray( "button", "targetname" );

Do you have multiple triggers with the targetname of button, if you only have 1 then you need to use GetEnt
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 5 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
×
pashan's Groups
Mapper Has released one or more maps to the UGX-Mods community.
i have 5 trigs with that targetname
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I imagine that its because you didn't add a space after your for() loop. If you used brackets you probably wouldn't have ran into any issues(its the only potential one that i could see).

EDIT: and i don't think you can call an array onto sethintstring(); or setcursorhint(); moved to in the loop. Also moved the var value watcher into its own function.

Code Snippet
Plaintext
main()
{
level.TeddyCount = 0;
switch = GetEntArray( "button", "targetname" );
for( i = 0; i < switch.size; i++ )
{
switch[i] sethintstring("");
switch[i] setCursorHInt( "HINT_NOICON" );
switch[i] thread trigger();
}
level thread watch_usage();
}
watch_usage()
{
for(;;)
{
if( level.TeddyCount == 5 )
{
//double point give code goes here.
}
wait .05;
}
}
I don't think theres any difference, but when i add or subtract a value from a variable i always use:

Code Snippet
Plaintext
var++;

or

Code Snippet
Plaintext
var--;

Not sure if that actually matters though.

Last Edit: May 27, 2014, 05:16:16 am by daedra descent

 
Loading ...