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

need help for my custom script for gungame

broken avatar :(
Created 9 years ago
by Wolf_Silver
0 Members and 1 Guest are viewing this topic.
2,409 views
broken avatar :(
×
broken avatar :(
Location: frPontault-Combault, France
Date Registered: 18 October 2014
Last active: 2 months ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Signature
Visitez mon site : http://www.fr-mapping.net/index.php pour rejoindre la communauté Française sur le mod tools!
visit my website : http://www.fr-mapping.net/index.php to join french communauty on mod tools
×
Wolf_Silver's Groups
Hello here my entire script for gungame :
Code Snippet
Plaintext
/*
Non du script : gungame.gsc
Auteur : [inVc] Wolf_silver
Version : 1.0
Note : Script pour le mode jeu d'armes du  "frmappingmod". Ne prenez pas ce script pour votre propre map sans permission!! en revanche pour les utilisateurs du frmappingmod, ce script peut-être modifiées.
*/
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_anim;

main()
{
iprintlnbold("init");
players = get_players();
    level.gungame = true;
players.gungame_points = 0;
if( level.gungame == true)
{
for(i=0;i<players.size;i++)
{
players[i] AllowMelee( false );   // Désactive le couteau
players[i] thread GungameAmmo(); // Désactive les grenades et redonne des munitions en permanence
}
}
}

GungameCheckPoints(gungame_points)
{
players = get_players();
 for(i=0;i<players.size;i++)
{
players[i].gungame_points++;
iprintlnbold("point ajoute");
GungameWeapons(players[i],gungame_points);
}


}
/*
//////////////////////////////////////////////////////////////////////////////////////////////// Armes////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////// Vous pouvez personnaliser les armes ici/////////////////////////////////////////////////////
*/
GungameWeapons(players,gungame_points)
{
if(players.gungame_points == 4)
{
players giveweapon( "makarov" );
players takeWeapon( "bo1_m1911" );
players switchtoweapon( "makarov" );
current_gun = players getcurrentweapon();
}
}
/*
//////////////////////////////////////////////////////////////////////////////////////////////// Armes////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////// Vous pouvez personnaliser les armes ici/////////////////////////////////////////////////////
*/
GungameAmmo()
{
players = get_players();
for(i=0;i<players.size;i++)
{
while(level.intermission == false)
{
current_gun = players[i] getcurrentweapon();
if(self HasWeapon("molotov"))
self TakeWeapon("molotov");

if(self HasWeapon("zombie_cymbal_monkey"))
self TakeWeapon("zombie_cymbal_monkey");

if(self HasWeapon("fraggrenade"))
self TakeWeapon("fraggrenade");

if(self HasWeapon("stielhandgranate"))
self TakeWeapon("stielhandgranate");
self giveMaxAmmo(current_gun);
wait 0.1;
}
}
}

I have also put this:
Code Snippet
Plaintext
if(level.gungame == true)
{
for(i=0;i<players.size;i++)
{
thread maps\gungame::GungameCheckPoints(players[i].gungame_points);
wait 0.1;
}
}

in _zombiemode_score.gsc after:
Code Snippet
Plaintext
case "death":
points = level.zombie_vars["zombie_score_kill"];
points += player_add_points_kill_bonus( mod, hit_location );
if(IsDefined(self.kill_tracker))
{
self.kill_tracker++;
}

all works exept major thing.. when i kill only 1 zombies i obtain makarov becausa after many test i think gungame_points of function "GungameChecksPoints()" is not same as function "GungameWeapons()"

i hope you will understand me and my terrible english :) thanks to read this message and double thanks if you can help me ^^
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Code Snippet
Plaintext
GungameWeapons(players[i],gungame_points);

GungameWeapons(players[i].gungame_points);

you used a comma instead
Last Edit: October 11, 2015, 09:01:57 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: frPontault-Combault, France
Date Registered: 18 October 2014
Last active: 2 months ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
Wolf_Silver's Groups
I don't understand what you want say comma is normal because GungameWeapons() have 2 arguments not?
Marked as best answer by Wolf_Silver 9 years ago
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Code Snippet
Plaintext
GungameWeapons(players,gungame_points)
{
if(players.gungame_points == 4)

then this makes no sense lol, should be

Code Snippet
Plaintext
GungameWeapons(players,gungame_points)
{
if(gungame_points == 4)

its never going to check the argument you passed, coz your telling it to check a property by that name on the player instead

Code Snippet
Plaintext
players = get_players();
    level.gungame = true;
players.gungame_points = 0;

this also wont work, as "players" is an array, do this :

Code Snippet
Plaintext
players = get_players();
level.gungame = true;
for ( i = 0; i < players.size; i++ )
{
    players[ i ].gungame_points = 0;
}
Last Edit: October 11, 2015, 09:22:12 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: frPontault-Combault, France
Date Registered: 18 October 2014
Last active: 2 months ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
Wolf_Silver's Groups
Thanks man! That's worked perfectly! and yeah i am new to script as you can see lol

 
Loading ...