SA-MP Forums Archive
Help needed please! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help needed please! (/showthread.php?tid=104537)



Help needed please! - Tyler_Idy - 25.10.2009

dcmd_join(playerid, params[])
{
new pName[24], PlayerFile[50], pJob[50];

GetPlayerName(playerid, pName, sizeof(pName));
format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);

if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You aren't registered! Use /register to create an account.");

if(dini_Exists(PlayerFile))
{
pJob[24] = dini_Int(PlayerFile, "Job");

if(PlayerInfo[playerid][Job] == 0)
{
if(IsPlayerInRangeOfPoint(playerid,1,2557.1714,206 4.3223,11.0995))
{
PlayerInfo[PlayerFile][Job] = 1
SendClientMessage(playerid, COLOR_WHITE, "You are now a gun dealer.");
dini_IntSet(PlayerFile, "Job", 1);
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not within the job pickup!");
}
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You already have a job!");
}
}
#pragma unused params
return 1;

}

error:

C:\Users\Administrator\Desktop\Pawno 0.3\filterscripts\TAdmin.pwn(892) : error 033: array must be indexed (variable "PlayerFile")

What do i need to do to fix this?


Re: Help needed please! - yom - 25.10.2009

Obvious mistake at this line:

PlayerInfo[PlayerFile][Job]


Re: Help needed please! - Tyler_Idy - 25.10.2009

What is the mistake? Im sorry, im just under standing the dini and dcmd stuff...


Re: Help needed please! - Tyler_Idy - 25.10.2009

NVM! I DID IT ALL BY MYSELF!!!


Re: Help needed please! - yom - 25.10.2009

-delete-


Re: Help needed please! - Tyler_Idy - 25.10.2009

actualy i had to make it PlayerInfo[playerid][Job] = 1;



Re: Help needed please! - yom - 25.10.2009

Yes, that was a pretty dumb mistake, next time please just use your brain for few minutes, before posting.