Help for a little job!
#1

Hi there. I have a little problem. I`m trying to make a little job for a RP server, and it gives me this error : error 033: array must be indexed

Код:
dcmd_goduty(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 3, 2371.9854, 2759.2981, 10.8203) == 1)
	{
	  new file[128], pname[MAX_PLAYER_NAME], job[256];
	  job = dini_Get(file, "job");
		GetPlayerName(playerid, pname, sizeof(pname));
		if(GetPlayerState(playerid) == 1 && job == 1)
		{
		  SendClientMessage(playerid, COLOR_GOLD, "Now go and get a garbage truck and do your job!");
  	}
  	else SendClientMessage(playerid, COLOR_GOLD, "You must be on foot! Get out of the vehicle.");
  	return 1;
	}
	else SendClientMessage(playerid, COLOR_GOLD, "You don`t have that job or you are not at the duty position!");
	return 1;
}
dcmd_takejob(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 3, 2371.9854, 2759.2981, 10.8203) == 1)
	{
	  new file[128], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(file, sizeof(file), "\\Users\\%s.ini", pname);
		dini_IntSet(file, "job", 1);
		SendClientMessage(playerid, COLOR_GOLD, "Congratulations with your new job!");
	}
	return 1;
}
Reply
#2

Since job is an integrer in your file, you need to replace job[256] to job and dini_Get(file, "job") to dini_Int(file, "job").
Reply
#3

Oh! How helpful! Alot of thanks man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)