PDA

View Full Version : save position on codjumper



genez_x
25th May 2017, 16:44
I wonder if anyone could change the speed of saving on codjumper mod cod4, right now it is slow, I would like to be (one press-one save).
If you could please help, thanks.
Ps:I think this is the part of the code that change that.


_MeleeKey()
{
self endon("disconnect");
self endon("killed_player");
self endon("joined_spectators");

for(;;)
{
if(self meleeButtonPressed())
{
catch_next = false;
count = 0;

for(i=0; i<0.5; i+=0.05)
{
if(catch_next && self meleeButtonPressed() && self isOnGround())
{
self thread [[level._cj_save]](1);
wait 0.05;
break;
}
else if(catch_next && self attackButtonPressed() && self isOnGround())
{
while(self attackButtonPressed() && count < 1)
{
count+=0.1;
wait 0.1;
}
if(count >= 1 && self isOnGround())
self thread [[level._cj_save]](3);
else if(count < 1 && self isOnGround())
self thread [[level._cj_save]](2);

wait 0.05;
break;
}
else if(!(self meleeButtonPressed()) && !(self attackButtonPressed()))
catch_next = true;

wait 0.05;
}
}

wait 0.05;
}
}

IzNoGoD
25th May 2017, 19:09
_MeleeKey()
{
self endon("disconnect");
self endon("killed_player");
self endon("joined_spectators");

waspressed_melee = self meleebuttonpressed();
waspressed_use = self usebuttonpressed();
while(true)
{
if(self meleebuttonpressed() && !waspressed_melee)
{
self savepos();
waspressed_melee = true;
}
else if(!self meleebuttonpressed())
waspressed_melee = false;
if(self usebuttonpressed() && !waspressed_use)
{
self loadpos();
waspressed_use = true;
}
else if(!self usebuttonpressed())
waspressed_use = false;
wait 0.05;
}
}

genez_x
26th May 2017, 19:54
Hi again, I tried commenting the code (_MeleeKey()) and still works the saving, so I assume that the saving/loading code is somewhere on the .menus

IzNoGoD
26th May 2017, 22:58
Then either this code isnt loaded (loading code from .gsc inside the .ff) or you showed the wrong code altogether.

genez_x
27th May 2017, 01:05
maybe... but I cant find another use of meleekey than saving position.

genez_x
28th May 2017, 04:52
Thanks anyways iznogod!, i figured it out thanks, you can delete this.:o