[FilterScript] V-Inventory (Save/Load/Add/Remove/Use/Item)
#1

V-INVENTORY
What is this?
-The system inventory using textdraw .Easy to use .
Fuctions
pawn Код:
* This inventory full weapon can add /remove
*MAX INVENTORY SLOT IS 50
* Make folder Inventory if not will crash server
-ShowInventory(playerid)
-HideInventory(playerid)
-SaveInventory(playerid)/LoadInventory(playerid) //  put this in onplayerdisconnect and onplayerconnect
-AddInventoryItem(playerid,modelid,amount)
//+modelid is model item (search object on gg)
//+amount is amount of item
-RemoveInventoryItem(playerid,clickslot,slotuse,note[])
//+clickslot is slotitem in inventory
//+slotuse to remove slotuse
//+note will show in inventory EX:"Remove Medkit"
-RemoveItem(playerid,modelid,amount)
//+remove player item not need show inventory
-ResetInventory(playerid)
//+reset player all item
-GetPlayerItemAmount(playerid,modelid)
//+Check if player have item
-GetItemName(modelid,amount)
//+Get Item name ( add more in this stock)
-GetItemSlotUse(modelid)
//+Get slot need add this item ( add more in this stock)
-CreateItem(Model,Amount,usetext,useitemrot,Float:X, Float:Y, Float:Z,world, interior)
//+Create a item ,modelid , amount , usetext ==1 will show label,useitemrot ==1 to set item rot custom,x,y,z,world,int
-SetItemRot(objectid,modelid)
//+Set item rot ( add more in this stock)
-DestroyItem(itemid)
-PickupItem(playerid)
CALLBACKS
pawn Код:
OnPlayerUseItem(playerid,modelid,amount,clickslot)
COMMAND
pawn Код:
/setslot //set player inventory slot
/setskin //cmd test
/giveweapon //cmd test
Example Script create item medkit
pawn Код:
#define ITEM_MEDKIT 1580
AddInventoryItem(playerid,ITEM_MEDKIT,1);
public OnPlayerUseItem(playerid,modelid,amount,clickslot)
{
 if(modelid == ITEM_MEDKIT)
 {
 SetPlayerHealth(playerid,100);
 RemoveInventoryItem(playerid,clickslot,GetItemSlotUse(modelid),"Use Medkit-Remove");
 }
}
//COMMAND use medkit with zcmd
CMD:removemedkit(playerid,params[])
{
 if(GetPlayerItemAmount(playerid,ITEM_MEDKIT) >= 1)
 {
 SetPlayerHealth(playerid,100);
 RemoveItem(playerid,ITEM_MEDKIT,1);
 }
 else
 {
 SendClientMessage(playerid,-1,"You no have item medkit");
 }
 return 1;
}
Create a Item Medkit on land with zcmd
pawn Код:
CMD:dropmedkit(playerid,params[])
{
 if(GetPlayerItemAmount(playerid,ITEM_MEDKIT) >= 1)
 {
 new Float:x,Float:y,Float:z;
 GetPlayerPos(playerid,x,y,z);
 CreateItem(ITEM_MEDKIT,1,1,1,x,y,z-0.75,GetPlayerVitrualWorld(playerid),GetPlayerInterior(playerid));
 RemoveItem(playerid,ITEM_MEDKIT,1);
 }
 else
 {
 SendClientMessage(playerid,-1,"You no have item medkit");
 }
 return 1;
}
-How to Add Name for item EX:medkit
pawn Код:
stock GetItemName(modelid,amount)// find this stock
{
    new modelname[128];
    switch(modelid)
    {
    case ITEM_MEDKIT:format(modelname,sizeof(modelname),"Medkit/%d",amount);// add this like to add name
    default: format(modelname, sizeof(modelname), "-ITEM-");
    }
    return modelname;
}
EX: medkit you want 2 slot to put in inventory
pawn Код:
stock GetItemSlotUse(modelid)//find this stock
{
    switch(modelid)
    {
    case ITEM_MEDKIT: return 2; //add slot need to loot this item
    default: return 1;
    }
    return 1;
}
How to set item rot when item create?EX:medkit with rot 90 0 0
pawn Код:
stock SetItemRot(objectid,modelid)// find this stock
{
    switch(modelid)
    {
    case ITEM_MEDKIT: return SetDynamicObjectRot(objectid,90,0,0);
    default: return SetDynamicObjectRot(objectid,0,0,0);
    }
    return 1;
}
VIDEO
[ame]http://www.youtube.com/watch?v=7jFEiqmFqqs[/ame]
DOWNLOAD
pawn Код:
Incognito-Streamer
******-sscanf2
Zeex-Zcmd
SouthClaw-IniFile
VinPure-NhatNguyen:Made script
-You can re-release this script if you not remove the credits
-You can not sell or talk this script made by you
Language English:GitHud V-Inv-Eng
Language VietNam:GitHud V-Inv-VN
Reply
#2

This is nice, great effort !
Reply
#3

Awesome !
Reply
#4

Thank you.
Reply
#5

Awesome ! 10/10
Reply
#6

amazing effect, neat work, awsome progress nice work buddy.
Reply
#7

Tks, if you found bug please report me (pm)
Add 2 Example script
Reply
#8

Love it!!
Reply
#9

Tks. +Rep if you like it
Reply
#10

7/10 .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)