AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Code replacement (https://forums.alliedmods.net/showthread.php?t=306117)

Suki1997 03-16-2018 19:10

Code replacement
 
Is there any replacement for this, to have a same function but diff less valuable code?

public fw_updateclientdata(id, sw, cd_handle)
{
//this function overrides the client side sounds and stuff
if (user_has_pbgun(id) && cd_handle)
{

set_cd(cd_handle, CD_ID, 1);
get_cd(cd_handle, CD_flNextAttack, nextattack[id]);

return FMRES_HANDLED;

}
return FMRES_IGNORED;
}

I removed all high price codes in Pb, but i cant find better replacement for this one here, do you guys know some function that does the same, just way better and less memory usage?

Black Rose 03-17-2018 07:11

Re: Code replacement
 
Follow the link in my signature.

Suki1997 03-17-2018 07:15

Re: Code replacement
 
I found solution for Y, and just now i found solution for X, there is always solution i just forgot where to look first..

Black Rose 03-17-2018 07:23

Re: Code replacement
 
I don't even see the problem with the code as is.
You say it's wasteful of memory, all I see is one global variable worth 128B.
So unless you start giving some reasons why this code wouldn't be good nobody will waste their FREE time.

You are telling us that you want code to replace other code with. But you haven't even told us what the code should do. This is the XY-problem and it cannot be solved unless you tell us X.

Suki1997 03-17-2018 07:32

Re: Code replacement
 
This sets client side for sound of shooting gun, thats a waste of memory and tottaly usseles, and there is no replacement, i tho there is, you can easily erase it, but in each model that you put on server, you gotta set in models sequences sound path.. do you understand better now?


All times are GMT -4. The time now is 11:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.