Page 1 of 1

ammo h4x

Posted: February 11th, 2010, 1:53 pm
by TTTT
*SOLVED*


Hi guys, i wonder if its possible to make a trigger on my map that will give the player full ammo when pressing F?

Re: ammo h4x

Posted: February 11th, 2010, 4:38 pm
by WorldDomoNation
Are you making a map? It sounds like you just want a bind.

Make sure you are in devmap:

bind f player_sustainammo 1

that should do it.

Re: ammo h4x

Posted: February 11th, 2010, 6:30 pm
by TTTT
no, on my finished map theres going to be an ammo stack were players shoulld get full ammo. sorry if i was unclear and i will edit the post

Re: ammo h4x

Posted: February 11th, 2010, 11:07 pm
by Drofder2004
self GiveMaxAmmo( self.pers["weapon"] );

Code: Select all

main()
{
thread fillammo();
}

fillammo()
{
trig = getent("<triggername>", "targetname");

while(1)
{
trig waittill("trigger", user);
user giveMaxAmmo(self GetCurrentWeapon());
}
}
Try that.

Re: ammo h4x

Posted: February 12th, 2010, 2:08 pm
by TTTT
i think were on the right way, but i get an error which you can see on the screenshot i posted. This is my mp_kakariko.gsc

main()
{

maps\mp\_load::main();
maps\mp\_giveammo::main();

ambientPlay("ambient_backlot_ext");

game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";

setdvar( "r_specularcolorscale", "1" );

setdvar("r_glowbloomintensity0",".25");
setdvar("r_glowbloomintensity1",".25");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");


}




And heres my _giveammo.gsc





main()
{
thread fillammo();
}

fillammo()
{
trig = getent("giveammo", "targetname");

while(1)
{
trig waittill("trigger", user);
user giveMaxAmmo(self GetCurrentWeapon());
}
}


I made the trigger a trigger_multiple and gave it the key/value of: targetname/giveammo.
What shoulld i do with that self GiveMaxAmmo( self.pers["weapon"] ); you posted?



Thx for helping, i really appriciate it :)

Re: ammo h4x

Posted: February 12th, 2010, 3:00 pm
by Rezil
remove self and try again.

Re: ammo h4x

Posted: February 12th, 2010, 4:14 pm
by Buzzard
Replace "self" to "user" at the getCurrentWeapon() function:

Code: Select all

main()
{
        thread fillammo();
}

fillammo()
{
        trig = getEnt("giveammo", "targetname");

        while(1)
        {
                trig waittill("trigger", user);
                user giveMaxAmmo(user getCurrentWeapon());
        }
}

Re: ammo h4x

Posted: February 12th, 2010, 8:34 pm
by TTTT
NiCE :D thanks guys that was the problem. Problem solved :)

Re: ammo h4x

Posted: February 12th, 2010, 8:59 pm
by Drofder2004
sorry, my bad :)