if(newkeys == KEY_YES)
{
printf("Passed key");
new a;
if(IsPlayerInRangeOfPoint(playerid, 2.0, AtmInfo[a][aPosX], AtmInfo[a][aPosY], AtmInfo[a][aPosZ]))
{
printf("First passed");
if(PlayerInfo[playerid][AtmCard] != 1)
{
ERROR(playerid, "You need to purchase Atm Card");
return 1;
}
SPD(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "Bank", "Withdraw money\nPut in bank", "Select", "Leave");
printf("Dialog shown");
return 1;
}
}
#define MAX_ATM 51
#define ATM_OBJECT 2942
enum aInfo
{
aID,
Float:aPosX,
Float:aPosY,
Float:aPosZ,
Float:aAngle,
aInt,
aVW,
bool: AtmExist,
}
new AtmInfo[MAX_ATM][aInfo],
Text3D:AtmLabel[MAX_ATM],
AtmObject[MAX_ATM],
Iterator: i_ATM<MAX_ATM>;
#define MAX_ATM 51
#define ATM_OBJECT 2942
enum aInfo
{
aID,
Float:aPosX,
Float:aPosY,
Float:aPosZ,
Float:aAngle,
aInt,
aVW,
bool: AtmExist,
}
new AtmInfo[MAX_ATM][aInfo],
Text3D:AtmLabel[MAX_ATM],
AtmObject[MAX_ATM],
Iterator: i_ATM<MAX_ATM>,
Atm_Count;
// Whenever you add an ATM
Atm_Count++;
// OnPlayerKeyStateChange
printf("Passed key");
new a = 0;
for (; a < Atm_Count; a++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0, AtmInfo[a][aPosX], AtmInfo[a][aPosY], AtmInfo[a][aPosZ]))
break;
}
if (a != Atm_Count) // if a didn't reach Atm_Count, then the player is near an ATM
{
printf("First passed");
if(PlayerInfo[playerid][AtmCard] != 1)
{
ERROR(playerid, "You need to purchase Atm Card");
return 1;
}
SPD(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "Bank", "Withdraw money\nPut in bank", "Select", "Leave");
printf("Dialog shown");
return 1;
}
Text3D:AtmLabel[MAX_ATM]
AtmObject[MAX_ATM]
if(newkeys == KEY_SECONDARY_ATTACK)
{
new org, OrgID = OrgInfo[org][oID];
if(IsPlayerInRangeOfPoint(playerid, 2.0, OrgInfo[org][oExitX], OrgInfo[org][oExitY], OrgInfo[org][oExitZ]))
{
if(PlayerInfo[playerid][OrgJoined] != OrgID || PlayerInfo[playerid][OrgLeader] != OrgID)
{
ERROR(playerid, "You are not member of that org");
return 1;
}
SetPlayerInterior(playerid, OrgInfo[org][oInt]);
SetPlayerVirtualWorld(playerid, OrgInfo[org][oVW]);
SPP(playerid, OrgInfo[org][oIntX], OrgInfo[org][oIntY], OrgInfo[org][oIntZ]);
}
}
Try it without returns, so in the first one try keeping only the second return, if that doesn't work than use only the first one. Hope its not counfusing.
|
Okay but explain me then how is this working??
PHP Code:
|