Defining from array
#1

hi guys i wanted to make this thing

So there are bunch of stuff in a array like this
Код:
enum EJobInfo  {
	EJobName[MAX_JOB_NAME],
	Float:EJobPickupX,
	Float:EJobPickupY,
	Float:EJobPickupZ,
	EJobPickupInt,
	EJobPickupVW,
	EJobPickupID,
	Text3D:EJobText,
	Float:EJobSpotX,
	Float:EJobSpotY,
	Float:EJobSpotZ,
	EJob_Illegal,
};
new JobPickups[][EJobInfo] = { 
	{"Trash Cleaner",359.68, 180.25, 1008.38, 3, 1,  0, Text3D:0,2322.636474, -2077.395263, 13.321226, 0},
	{"Drug Dealer",2143.82, -1674.08, 15.09,0 ,0 ,0 , Text3D:0,2168.98, -1679.85, -15.09, 1},
	{"Arms Dealer",2666.66, -1108.06, 69.39,0 ,0 ,0 , Text3D:0,2666.66, -1108.06, 69.39, 1},
	{"Taxi Driver", 359.47, 184.91, 1008.38, 3, 1, 0 ,Text3D:0, 1763.25, -1900.96, 13.56, 0},
	{"Mercenary", 757.99, 5.37, 1000.70, 5,0, 0, Text3D:0,2232.48, -1726.69, 13.55, 1},
	{"Mechanic",358.99, 167.42, 1008.38, 3, 1, 0, Text3D:0, 1637.53, -1103.15, 23.91, 0},
	{"Smuggler",2196.027832, -2236.349121, 13.546875, 0, 0, 0, Text3D:0,2187.762695, -2273.814208, 13.546875,1},
	{"Lawyer",358.99, 163.11, 1008.38, 3, 1, 0, Text3D:0,358.62, 163.11, 1008.38,0},
	{"Pizza Man",2100.7856, -1804.1826, 13.5546, 0, 0, 0, Text3D:0,2100.7856, -1804.1826, 13.5546,0},
	{"Crafter",1900.399780, -1769.010864, 13.557812, 0, 0, 0, Text3D:0,1900.399780, -1769.010864, 13.557812,1}
};

jobsOnPickupPickup(playerid, pickupid) {
	new title[128];
	dialogstr[0] = 0;
	for(new i=0;i<sizeof(JobPickups);i++) {
		if(JobPickups[i][EJobPickupID] == pickupid) {
			format(dialogstr,sizeof(dialogstr),"{FFFFFF}Would you like to join the %s Job? Press \"{FF0000}Accept{FFFFFF}\" to accept, or \"{FF0000}Reject{FFFFFF}\" to reject",JobPickups[i][EJobName]);
			format(title,sizeof(title),"{00BFFF}%s Job Offer",JobPickups[i][EJobName]);
			new remaining = CanTakeJob(playerid);
			if(remaining != 0) {
				format(title, sizeof(title), "You must wait {FF6347}%d{FFFFFF} minute(s) for your job contract to finish!", remaining/60);
				SendClientMessage(playerid, X11_WHITE, title);
				return 0;
			}
			SetPVarInt(playerid, "JobOffer", i);
			ShowPlayerDialog(playerid, _:EJobs_JobOffer, DIALOG_STYLE_MSGBOX, title, dialogstr, "Accept", "Reject");
			movePlayerBack(playerid, 3.0);
		}
	}
	return 1;
}
I want to make arms dealer, crafter, and smuggler only if they are a part of a faction
this is how i defined

I want to make like if it is EJob_Illegal then only family members can join.

Код:
if(GetPVarInt(playerid, "Family") != 0) {
		SendClientMessage(playerid, X11_TOMATO_2, "You must be in a family.");
		return 1;
	}
Reply
#2

still want help!
Reply
#3

All you need to do is paste your snippet in the /join cmd in the illegal job spots.
Reply
#4

Quote:
Originally Posted by random123
Посмотреть сообщение
All you need to do is paste your snippet in the /join cmd in the illegal job spots.
Huh what? There isn't /join command pal there people get dialogs once they are on a pickup.
Reply
#5

need help asap!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)