13.04.2015, 12:59
Hello I'm using a loot system which spawns random items on the floor etc and I've made Cookies as loot as I have the servers currency to cookies the only problem is that the inventory system requires you to use the item before having the effect done.
For example:
Makes it so when the loot is used it adds the Cookie to the currency but I want it so that when I pick up the loot it automaticly adds the Cookie to the currency without having to use it
May I be assisted please?
For example:
Код:
OnPlayerUseItem(playerid,ItemName[]) { if(!strcmp(ItemName,"Cookie",true)) { if(pInfo[playerid][pCookies] += 1) return SendClientMessage(playerid,-1,"*"COL_WHITE" You have added one cookie to your currency.You can eat your cookies with /eatcookie."); pInfo[playerid][pCookies] += 1; RemoveSlotToInventory(playerid,"Cookie",1); } }
Код:
pInfo[playerid][pCookies] += 1;
May I be assisted please?