


Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!function bank()
{
players = GetPlayers();
for (i = 0;i<players.size;i++)
{
players[i].balance = players[i] GetDvarInt("bank_points", 0);
}
level thread deposit();
level thread withdraw();
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
prob coz your "getting" a dvar that doesnt exist "before setting" it then trying to use it
also i believe GetDvar is global, so shouldnt be used "on" a player
function bank()
{
level.balance = GetDvarInt("bank_points", 0);
level thread deposit();
level thread withdraw();
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
could do getDvarInt( "bank_player_" + int, "0" );
function bank()
{
players = GetPlayers();
for (i = 0;i<players.size;i++)
{
GetDvarInt("bank_player_" + i, 0);
players[i].order = i;
}
level thread deposit();
level thread withdraw();
}
function deposit()
{
trig_depo = GetEnt("deposit_trig","targetname");
trig_depo SetHintString("Hold ^3[{+activate}]^7 to Deposit into Bank[Amount:1000]");
trig_depo SetCursorHint("HINT_NOICON");
while(1)
{
while(1)
{
trig_depo waittill("trigger", player);
if (player zm_score::can_player_purchase(1000))
{
player zm_score::minus_to_player_score(1000);
SetDvar("bank_player_" + self.order, GetDvarInt("bank_player_" + self.order)+1000);
IPrintLn("Deposited $1000(New Total = " + GetDvarInt("bank_player_" + self.order) + ")");
player PlayLocalSound("purchase_accept");
}
else
{
player PlayLocalSound("purchase_deny");
IPrintLn("Not Enough Money");
}
break;
}
wait(0.25);
}
}
function withdraw()
{
trig_with = GetEnt("withdraw_trig", "targetname");
trig_with SetHintString("Hold ^3[{+activate}]^7 to Withdraw From Bank\n[Amount: 1000][Fee: 100]");
trig_with SetCursorHint("HINT_NOICON");
while(1)
{
while(1)
{
trig_with waittill("trigger", player);
if (GetDvarInt("bank_player_" + self.order) >= 1000 && player zm_score::can_player_purchase(100))
{
player zm_score::add_to_player_score(1000);
SetDvar("bank_player_" + self.order, GetDvarInt("bank_player_" + self.order)-1000);
IPrintLn("Withdrew $1000(New Total = " + GetDvarInt("bank_player_" + self.order) + ")");
wait(0.01);
player zm_score::minus_to_player_score(100);
player PlayLocalSound("purchase_accept");
}
else if (player zm_score::can_player_purchase(100))
{
player PlayLocalSound("purchase_deny");
IPrintLn("Not Enough Money");
}
else
{
player PlayLocalSound("purchase_deny");
IPrintLn("Insufficient Funds(Total = " + GetDvarInt("bank_player_" + self.order) + ")");
}
break;
}
wait(0.25);
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() Oil Rig Beta Access |
self.order
player.order
function bank()
{
players = GetPlayers();
for (i = 0;i<players.size;i++)
{
players[i].name_split = strTok(players[i].playername, " ");
if (players[i].name_split.size == 2)
{
GetDvarInt("bank_player_" + players[i].name_split[0] + players[i].name_split[1], 0);
}
else
{
GetDvarInt("bank_player_" + players[i].playername, 0);
}
}
level thread deposit();
level thread withdraw();
}
function deposit()
{
trig_depo = GetEnt("deposit_trig","targetname");
trig_depo SetHintString("Hold ^3[{+activate}]^7 to Deposit into Bank[Amount:1000]");
trig_depo SetCursorHint("HINT_NOICON");
while(1)
{
while(1)
{
trig_depo waittill("trigger", player);
if (player zm_score::can_player_purchase(1000))
{
player zm_score::minus_to_player_score(1000);
player.name_split = strTok(player.playername, " ");
if (player.name_split.size == 2)
{
SetDvar("bank_player_" + player.name_split[0] + player.name_split[1], GetDvarInt("bank_player_" + player.name_split[0] + player.name_split[1])+1000);
IPrintLn("Deposited $1000(New Total = " + GetDvarInt("bank_player_" + player.name_split[0] + player.name_split[1]) + ")");
}
else
{
SetDvar("bank_player_" + player.playername, GetDvarInt("bank_player_" + player.playername)+1000);
IPrintLn("Deposited $1000(New Total = " + GetDvarInt("bank_player_" + player.playername) + ")");
}
player PlayLocalSound("purchase_accept");
}
else
{
player PlayLocalSound("purchase_deny");
IPrintLn("Not Enough Money");
}
break;
}
wait(0.25);
}
}
function withdraw()
{
trig_with = GetEnt("withdraw_trig", "targetname");
trig_with SetHintString("Hold ^3[{+activate}]^7 to Withdraw From Bank\n[Amount: 1000][Fee: 100]");
trig_with SetCursorHint("HINT_NOICON");
while(1)
{
while(1)
{
trig_with waittill("trigger", player);
player.name_split = strTok(player.playername, " ");
if (player.name_split.size == 2)
{
if (GetDvarInt("bank_player_" + player.name_split[0] + player.name_split[1]) >= 1000 && player zm_score::can_player_purchase(100))
{
player zm_score::add_to_player_score(1000);
SetDvar("bank_player_" + player.name_split[0] + player.name_split[1], GetDvarInt("bank_player_" + player.name_split[0] + player.name_split[1])-1000);
IPrintLn("Withdrew $1000(New Total = " + GetDvarInt("bank_player_" + player.name_split[0] + player.name_split[1]) + ")");
wait(0.01);
player zm_score::minus_to_player_score(100);
player PlayLocalSound("purchase_accept");
}
else if (player zm_score::can_player_purchase(100) == false)
{
player PlayLocalSound("purchase_deny");
IPrintLn("Not Enough Money");
}
else
{
player PlayLocalSound("purchase_deny");
IPrintLn("Insufficient Funds(Total = " + GetDvarInt("bank_player_" + player.name_split[0] + player.name_split[1]) + ")");
}
}
else
{
if (GetDvarInt("bank_player_" + player.playername) >= 1000 && player zm_score::can_player_purchase(100))
{
player zm_score::add_to_player_score(1000);
SetDvar("bank_player_" + player.playername, GetDvarInt("bank_player_" + player.playername)-1000);
IPrintLn("Withdrew $1000(New Total = " + GetDvarInt("bank_player_" + player.playername) + ")");
wait(0.01);
player zm_score::minus_to_player_score(100);
player PlayLocalSound("purchase_accept");
}
else if (player zm_score::can_player_purchase(100) == false)
{
player PlayLocalSound("purchase_deny");
IPrintLn("Not Enough Money");
}
else
{
player PlayLocalSound("purchase_deny");
IPrintLn("Insufficient Funds(Total = " + GetDvarInt("bank_player_" + player.playername) + ")");
}
}
break;
}
wait(0.25);
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() Oil Rig Beta Access |
SetSavedDvar( <dvar>, <value> );
Code SnippetPlaintextSetSavedDvar( <dvar>, <value> );
and otherwise you have to use stats to be able to save it between games.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() Oil Rig Beta Access |
I couldn't find "SetSavedDvar" in the BO3 API.
How do you use stats?