Dynamic Lockers(small fix probably) -
RLGaming - 14.09.2012
Hi!
So, I have this dynamic locker system for a faction(LSPD).
When I click 'move to my location' it creates a locker point at my location and creates 3DText, it all works and I can /locker and that exact point
but when I try to set ANOTHER locker point nothing happens..
Code:
Код:
CMD:lockers(playerid, params[])
{
new rank = PlayerInfo[playerid][pLSPD];
if(rank < 1) return SCM(playerid, COLOR_WHITE, "You are not authorised to use that command.");
{
for(new i=1; i < MAX_FUEL_STATIONS; i++)
{
if(LockersPointCreated[i])
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, LockerPos[i][0], LockerPos[i][1], LockerPos[i][2]))
{
ShowPlayerDialog(playerid, 249, DIALOG_STYLE_LIST, "Lockers", "Duty\nEquipment\nClothing\nUnder-Cover", "Select", "Cancel");
return 1;
}
}
}
}
return 1;
}
Код:
new LockersPointCreated[MAX_LOCKERS_POINT];
new Float:LockerPos[MAX_LOCKERS_POINT][3];
#define MAX_LOCKERS_POINT 50
Dialog response:
Код:
if(dialogid == 1352) // LSPD LOCKER POINTS RESPONSES
{
if(response)
{
if(listitem == 0)
{
for(new i=1; i < MAX_LOCKERS_POINT; i++)
{
if(!LockersPointCreated[i])
{
new Float: fTextPos[3];
GetPlayerPos(playerid, fTextPos[0], fTextPos[1], fTextPos[2]);
Create3DTextLabel(labelstr, 0xFFFFFFFF, fTextPos[0], fTextPos[1], fTextPos[2], 5.0, GetPlayerVirtualWorld(playerid), .testLOS = 1);
GetPlayerPos(playerid, LockerPos[i][0], LockerPos[i][1], LockerPos[i][2]);
LockersPointCreated[i] = 1;
SaveFactionSystem(i);
}
if(listitem == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You have cancelled the locker position.");
}
}
}
}
}
I dont get any warnings or errors either
Ignore the save faction system too, I added that a few minutes ago, that has nothing to do with it
Thanks so much ;3
Re: Dynamic Lockers(small fix probably) -
RLGaming - 14.09.2012
Anyone?
+rep for anyone who can even help
Re: Dynamic Lockers(small fix probably) -
arvifilter - 14.09.2012
the bug is at the response,what your cmd does is making all lockers on one point,
make a new variable like CURRENT_MADE_LOCKERS,
stock CountLockers and make it count current made lockers and set the value for the variable.
then at the dialog response make a new variable and define it as CURRENT_MADE_LOCKERS + 1(makes the next id)
and use the variable instead of the i which goes to the limit.
hope it helped
if you want help more detailfully pm me
Re: Dynamic Lockers(small fix probably) -
RLGaming - 14.09.2012
PM'd you :P