Because the use function is not here...
Search for something like "actionslot1"
EDIT: ammoWaitThread();
I got this ammo box from the AIZombies mod, but I'm trying to make it give ammo when you press F.
I've tried quite alot, but when I seem to do it it SPAMS me with ammo when I havent even clicked F.Code:giveAmmo() { level endon("disconnect"); for(;;) { foreach( player in level.players ) { if(!isDefined(player.ammoing)) player.ammoing = false; if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing) { if(player.sessionstate != "playing") continue; player thread ammoWaitThread(); player playlocalsound("weap_pickup"); player giveMaxAmmo(player getCurrentWeapon()); player giveMaxAmmo(player getCurrentOffhand()); } } wait 0.05; } } ammoWaitThread() { self endon("death"); self endon("disconnect"); self.ammoing = true; wait 1; self.ammoing = false; }
So either a solution for that, or a code that would spawn a box that gives ammo at <coordinates>. Though I'd like it to be a thread that I can do into a create block, like i did here:
Second one is a box that gives a semtex/frag/c4/stun or whatever. I havent gotten this already, and I'd either like a thread for <coordinates> or something I could add into a block as stated above.Code:CreateAmmoBlock(pos, angle) { block = spawn("script_model", pos ); block setModel("com_bomb_objective"); block.angles = angle; block Solid(); block thread giveAmmo(); block CloneBrushmodelToScriptmodel( level.airDropCrateCollision ); wait 0.01; }
EDIT: Oh yeah, and make the ammo sign over the ammo box would be pwnage (:
Tried to copypaste that too from the AIZombies but it kind of went.. bad
Thanks (:
Last edited by Arasonic; 10-04-2010 at 05:45 AM.
Because the use function is not here...
Search for something like "actionslot1"
EDIT: ammoWaitThread();
Heres what I tried shitloads of, but as I wrote it just spams me with ammo instead when I havent pressed F
Code:ammoWaitThread() { self endon("death"); self endon("disconnect"); self notifyOnPlayerCommand( "F", "+activate" ); self waittill("F"); self.ammoing = true; wait 3; self.ammoing = false; }
It is diffcult...Still can't get it right
May be this will help
Code:giveAmmo() { level endon("disconnect"); for(;;) { foreach( player in level.players ) { if(!isDefined(player.ammoing)) player.ammoing = false; if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing) //CHANGE 9732 TO 50 { if(player.sessionstate != "playing") continue; player thread ammoWaitThread(); player playlocalsound("weap_pickup"); player giveMaxAmmo(player getCurrentWeapon()); player giveMaxAmmo(player getCurrentOffhand()); } } wait 0.05; } } ammoWaitThread() { self endon("death"); self endon("disconnect"); self.ammoing = true; wait 1; self.ammoing = false; }
Last edited by alistair4322; 10-04-2010 at 08:43 AM.
Uhm, what did you do?
Code:giveAmmo() { level endon("disconnect"); for(;;) { foreach( player in level.players ) { if(!isDefined(player.ammoing)) player.ammoing = false; if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing) { if(player.sessionstate != "playing") continue; player thread ammoWaitThread(); player playlocalsound("weap_pickup"); player giveMaxAmmo(player getCurrentWeapon()); player giveMaxAmmo(player getCurrentOffhand()); } } wait 0.05; } } ammoWaitThread() { self endon("death"); self endon("disconnect"); for(;;) { if(player UseButtonPressed()) { self.ammoing = true; } wait 1; self.ammoing = false; }
Donate:
BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9
Handy Tools/Hacks:
Extreme Injector v3.7.3
A powerful and advanced injector in a simple GUI.
Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!
Minion Since: 13th January 2011
Moderator Since: 6th May 2011
Global Moderator Since: 29th April 2012
Super User/Unknown Since: 23rd July 2013
'Game Hacking' Team Since: 30th July 2013
--My Art--
[Roxas - Pixel Art, WIP]
[Natsu - Drawn]
[Natsu - Coloured]
All drawings are coloured using Photoshop.
--Gifts--
[Kyle]
That just gets me a bad syntax 0o
Ehhhhhh... It worked fine before I changed it again and added another }, but now when I added it, I got uninitialised variable 'player'
Another thing, this:
Is there any way I could make it come with text as the last one, 'Press F to swap for <weapon>'?Code:SpawnWeapon(weapName, coords, angles) { point = spawn("script_origin", coords); weap = SpawnWeap(weapName, point.origin); if(isDefined(angles)) weap.angles = angles; weap linkto( point ); return point; }