[Include] Job Framework - Create Jobs Easily
#3

Each of these callbacks are useless. Why would anyone ever need these? The user triggers these callbacks by calling functions so why would anyone need to use a callback? It just adds extra layers of convulsion.

Код:
forward OnJobCreate(jobID, Float:jPos_X, Float:jPos_Y, Float:jPos_Z); - CALLED AFTER CreateJob  FUNCTION 
forward OnPlayerGetNewJob(playerid, jobID); CALLED AFTER SetPlayerJob FUNCTION 
forward OnPlayerRemoveFromJob(playerid, jobID); CALLED AFTER RemovePlayerFromJob FUNCTION
You included it so why don't you use your own iterators? This leads to the next point where this helps big time.
Код:
#include <YSI\y_iterate>
No array validation checks.
Код:
stock GetJobPayment(jobID)
{
	return VAR__typeJob[VAR__Job[jobID][jobType]][JTYPpayment];
}
If you are going to use an enum use it! Write out as many entries as possible and avoid directly referencing array indexes. Yes you can do this but it gets ugly real fast.

Код:
enum main_job
{
	//Back-end
	jName[MAX_JOB_NAME],
	JobType:jobType,
	Float:jPosition[3],

	//Front-end
	jPickup
}
There is just so much substance lacking with this framework I don't know where to start.
Reply


Messages In This Thread
Job Framework - Create Jobs Easily - by Amagida - 23.12.2018, 11:24
Re: Job Framework - Create Jobs Easily - by DAKYSKYE - 23.12.2018, 11:51
Re: Job Framework - Create Jobs Easily - by Pottus - 25.12.2018, 02:13
Re: Job Framework - Create Jobs Easily - by Mugala - 27.12.2018, 03:40

Forum Jump:


Users browsing this thread: 1 Guest(s)