18.10.2014, 13:37
(
Последний раз редактировалось VinPure; 19.10.2014 в 00:38.
)
V-INVENTORY
What is this?
-The system inventory using textdraw .Easy to use .
Fuctions
CALLBACKS
COMMAND
Example Script create item medkit
Create a Item Medkit on land with zcmd
-How to Add Name for item EX:medkit
EX: medkit you want 2 slot to put in inventory
How to set item rot when item create?EX:medkit with rot 90 0 0
VIDEO
Language English:GitHud V-Inv-Eng
Language VietNam:GitHud V-Inv-VN
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)
pawn Код:
OnPlayerUseItem(playerid,modelid,amount,clickslot)
pawn Код:
/setslot //set player inventory slot
/setskin //cmd test
/giveweapon //cmd test
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;
}
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;
}
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;
}
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;
}
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;
}
[ame]http://www.youtube.com/watch?v=7jFEiqmFqqs[/ame]
DOWNLOADpawn Код:
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 VietNam:GitHud V-Inv-VN