Harmony 0 Posted July 2, 2018 Hello! I want to give players who registered early a reward but the problem is I don't know how to include sql database in my scripts. Can someone help me out with this? Quote Share this post Link to post Share on other sites
0 meko 170 Posted July 2, 2018 if you only want to compare account ID then there is no need to use SQL at all if (!(#REG_REWARD & (1 << 0)) && getcharid(CHAR_ID_ACCOUNT) < 3000000) { getitem(TIER_1_ITEM, 1); #REG_REWARD |= 1 << 0; } if (!(#REG_REWARD & (1 << 1)) && getcharid(CHAR_ID_ACCOUNT) < 2800000) { getitem(TIER_2_ITEM, 1); #REG_REWARD |= 1 << 1; } if (!(#REG_REWARD & (1 << 2)) && getcharid(CHAR_ID_ACCOUNT) < 2500000) { getitem(TIER_3_ITEM, 1); #REG_REWARD |= 1 << 2; } if (!(#REG_REWARD & (1 << 3)) && getcharid(CHAR_ID_ACCOUNT) < 2200000) { getitem(TIER_4_ITEM, 1); #REG_REWARD |= 1 << 3; } if (!(#REG_REWARD & (1 << 4)) && getcharid(CHAR_ID_ACCOUNT) < 2050000) { getitem(TIER_5_ITEM, 1); #REG_REWARD |= 1 << 4; } if (!(#REG_REWARD & (1 << 5)) && getcharid(CHAR_ID_ACCOUNT) < 2005000) { getitem(TIER_6_ITEM, 1); #REG_REWARD |= 1 << 5; } if (!(#REG_REWARD & (1 << 6)) && getcharid(CHAR_ID_ACCOUNT) < 2001000) { getitem(TIER_7_ITEM, 1); #REG_REWARD |= 1 << 6; } if (!(#REG_REWARD & (1 << 7)) && getcharid(CHAR_ID_ACCOUNT) < 2000300) { getitem(TIER_8_ITEM, 1); #REG_REWARD |= 1 << 7; } Just change TIER_X_ITEM to whatever item you want to give. This script uses the first 8 bits (1 byte) of the #REG_REWARD integer variable so you can use the last 3 bytes to store other data if you wish. 1 Harmony reacted to this Quote Share this post Link to post Share on other sites
0 Harmony 0 Posted July 3, 2018 Thanks alot meko! Quote Share this post Link to post Share on other sites
Hello! I want to give players who registered early a reward but the problem is I don't know how to include sql database in my scripts. Can someone help me out with this?
Share this post
Link to post
Share on other sites