ammo h4x

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
TTTT
CJ Wannabe
CJ Wannabe
Posts: 30
Joined: August 16th, 2009, 5:51 am

ammo h4x

Post by TTTT » February 11th, 2010, 1:53 pm

*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?
Last edited by TTTT on February 13th, 2010, 5:30 pm, edited 2 times in total.

User avatar
WorldDomoNation
CJ Worshipper
CJ Worshipper
Posts: 376
Joined: November 12th, 2008, 10:48 pm
Location: Connecticut
Contact:

Re: ammo h4x

Post by WorldDomoNation » February 11th, 2010, 4:38 pm

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.
that's a nice pic and all, but out of all the pictures you could have taken why'd you take a picture of a plant? :P
-Soviet
Because plants have some really small details. If a plant comes out nice in a photo, you have yourself a good camera ;)
-Drofder 2004
Yes, but if boobs come out really well in a photo you have a picture of boobs :wink:
-Soviet
Discussing Marshall's new camera lol^

Quit Humping And Start Jumping!

TTTT
CJ Wannabe
CJ Wannabe
Posts: 30
Joined: August 16th, 2009, 5:51 am

Re: ammo h4x

Post by TTTT » February 11th, 2010, 6:30 pm

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

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: ammo h4x

Post by Drofder2004 » February 11th, 2010, 11:07 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

TTTT
CJ Wannabe
CJ Wannabe
Posts: 30
Joined: August 16th, 2009, 5:51 am

Re: ammo h4x

Post by TTTT » February 12th, 2010, 2:08 pm

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 :)
You do not have the required permissions to view the files attached to this post.

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: ammo h4x

Post by Rezil » February 12th, 2010, 3:00 pm

remove self and try again.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
Buzzard
CJ Wannabe
CJ Wannabe
Posts: 23
Joined: November 5th, 2009, 7:13 pm

Re: ammo h4x

Post by Buzzard » February 12th, 2010, 4:14 pm

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());
        }
}

TTTT
CJ Wannabe
CJ Wannabe
Posts: 30
Joined: August 16th, 2009, 5:51 am

Re: ammo h4x

Post by TTTT » February 12th, 2010, 8:34 pm

NiCE :D thanks guys that was the problem. Problem solved :)

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: ammo h4x

Post by Drofder2004 » February 12th, 2010, 8:59 pm

sorry, my bad :)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest