Changed folder name.
Changed folder name.
This commit is contained in:
27
_module/nss/sfpb_withdraw.nss
Normal file
27
_module/nss/sfpb_withdraw.nss
Normal file
@@ -0,0 +1,27 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Scarface's Persistent Banking
|
||||
//:: sfpb_withdraw
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Written By Scarface
|
||||
*/
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
#include "sfpb_config"
|
||||
void main()
|
||||
{
|
||||
// Vars
|
||||
object oPC = GetPCSpeaker();
|
||||
string sID = SF_GetPlayerID(oPC);
|
||||
int nWithdraw = StringToInt(GetLocalString(OBJECT_SELF, "GOLD"));
|
||||
int nBanked = GetCampaignInt(GetName(GetModule()), DATABASE_GOLD + sID);
|
||||
|
||||
|
||||
// Give the amount required tot he player and store in the database
|
||||
GiveGoldToCreature(oPC, nWithdraw);
|
||||
int nTotal = nBanked - nWithdraw;
|
||||
SetCampaignInt(GetName(GetModule()), DATABASE_GOLD + sID, nTotal);
|
||||
|
||||
// Set custom token
|
||||
SetCustomToken(1000, IntToString(nTotal));
|
||||
}
|
Reference in New Issue
Block a user