SA-MP Forums Archive
Properly transfering code. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Properly transfering code. (/showthread.php?tid=435178)



Properly transfering code. - Nostrum - 05.05.2013

Hello. I would appriciate, if someone would explain me how to properly transfer code.
I want to get carrots - United Gaming RP's point and turf system to my own gamemode. Our scripts are fairly similar, but after transfering turfs, i got errors that some of the code wasnt defined while in u-rp it was. Even defining them didnt help.
If someone has time, could you copy the exact code places which i need to transfer? I know it sounds silly asking someone else to do the work for you, but i just dont know any other way. Im not so good at reading tutorials..


Re: Properly transfering code. - Pottus - 05.05.2013

Were the systems designed in their own include or are they slapped into the gamemode?


Re: Properly transfering code. - Nostrum - 05.05.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Were the systems designed in their own include or are they slapped into the gamemode?
I guess slapped.


Re: Properly transfering code. - Pottus - 05.05.2013

That could be a big part of the problem, it's difficult use systems that do not have a modular design so what ends up happening is parts of the system get intermixed into various callbacks which is difficult to extract. It's a poor way to script like that y_hooks can work wonders for organizing your code once you take a modular approach there will be less searching for code and your code won't mixed with unrelated system.


Re: Properly transfering code. - Nostrum - 05.05.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
That could be a big part of the problem, it's difficult use systems that do not have a modular design so what ends up happening is parts of the system get intermixed into various callbacks which is difficult to extract. It's a poor way to script like that y_hooks can work wonders for organizing your code once you take a modular approach there will be less searching for code and your code won't mixed with unrelated system.
But its still possible... I dont know anything about y_hooks so ill better stay away from unfamiliar things. Mind teaching me how to transfer the code as it is - without y_hooks?


Re: Properly transfering code. - Pottus - 05.05.2013

You need to find where all the parts of it are used for instance some might be used in OnPlayerKeyStateChange(), OnPlayerCommandText() etc it's a pain in the ass to do.