Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[forums.alliedmods.net] [DEV] TF2 Item Info v1.2 (15.04.12)


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 476
  • Lokalizacja:AMXX.PL
Offline

Napisano 15.04.2012 11:02

What is it?

List of natives that could be useful for plugin devs.

Optional:

TF2Items extension.
Gamedata from TF2Items Randomizer.

How to configure?

Not possible.

CVars & CMDs:


PHP Code:

sm_tf2ii_version // version
// commands
sm_tf2ii_refresh // rescan items_game.txt

Natives:


PHP Code:

/**
* @brief Is item exists in items_game.txt
*
* @param iItemDefinitionIndex -
*
* @return True if is it, false otherwose
**/
native bool:TF2II_IsValidItemID( iItemDefinitionIndex );

/**
* @brief Get item class
*
* @param iItemDefinitionIndex -
* @param strItemClass String to store item class
* @param iItemClassLength String length
*
* @noreturn
**/
native TF2II_GetItemClassByID( iItemDefinitionIndex, String:strItemClass[], iItemClassLength );

/**
* @brief Get item's slot number
*
* @param iItemDefinitionIndex -
*
* @return Item slot number
**/
native _:TF2II_GetItemSlotByID( iItemDefinitionIndex );

/**
* @brief Get item slot name
*
* @param iItemDefinitionIndex -
* @param strItemSlot String to store item slot
* @param iItemSlotLength String length
*
* @noreturn
**/
native TF2II_GetItemSlotNameByID( iItemDefinitionIndex, String:strItemSlot[], iItemSlotLength );

/**
* @brief Is item paintable?
*
* @param iItemDefinitionIndex -
*
* @return True if paintable, false otherwise
**/
native bool:TF2II_IsItemUsedByClass( iItemDefinitionIndex, iClass );

/**
* @brief Is item paintable?
*
* @param iItemDefinitionIndex -
*
* @return True if paintable, false otherwise
**/
native bool:TF2II_IsItemPaintable( iItemDefinitionIndex );

/**
* @brief Get number of attributes
*
* @param iItemDefinitionIndex -
*
* @return Number of attributes
**/
native _:TF2II_GetItemNumAttributes( iItemDefinitionIndex );

/**
* @brief -
*
* @param iItemDefinitionIndex -
* @param iSlotAttribute The attribute slot index, ranges from 0 to 15
* @param strAttributeName String to store attribute name
* @param iAttributeNameLength String length
*
* @return The attribute name; empty on failure
**/
native TF2II_GetItemAttributeName( iItemDefinitionIndex, iSlotAttribute, String:strAttributeName[], iAttributeNameLength );

/**
* @brief -
*
* @param iItemDefinitionIndex -
* @param iSlotAttribute The attribute slot index, ranges from 0 to 15
*
* @return The attribute ID; -1 on failure
**/
native _:TF2II_GetItemAttributeID( iItemDefinitionIndex, iSlotAttribute );

/**
* @brief -
*
* @param iItemDefinitionIndex -
* @param iSlotAttribute The attribute slot index, ranges from 0 to 15
*
* @return Attribute value
**/
native Float:TF2II_GetItemAttributeValue( iItemDefinitionIndex, iSlotAttribute );

/**
* @brief Get attribute name by ID
*
* @param strAttributeName String to store attribute name
* @param iAttributeNameLength String length
*
* @return Attribute ID on success, -1 otherwise
**/
native _:TF2II_GetAttributeIDByName( const String:strAttributeName[] );

/**
* @brief Get attribute name by ID
*
* @param iAttributeID -
* @param strAttributeName String to store attribute name
* @param iAttributeNameLength String length
*
* @return True on success, false otherwise
**/
native bool:TF2II_GetAttributeNameByID( iAttributeID, String:strAttributeName[], iAttributeNameLength );

/**
* @brief -
*
* @param hResults DataPack to store items IDs
* @param strItemClass Item class name
* @param iItemSlot Item slot number
* @param bFilterClass Should we check class or not
* @param bUsedByClasses Array of classes with rights (example: bUsedByClasses[0]=true meaning that we should find items which scout can equip)
*
* @return Number of results; -1 on error
**/
native _:TF2II_FindItemsIDsByCond( &Handle:hResults, const String:strItemClass[] = "", iItemSlot = -1, const String:strItemSlot[] = "", bool:bFilterClass = nope, bool:bUsedByClasses[10] = { nope, ... } );

/**
* @brief Get item based on items_game.txt
*
* @param iItemDefinitionIndex -
* @param hItem -
* @param iQuality (see TF2ItemQuality_ above)
* @param iLevel Item level (from 1 to 127)
*
* @return True on success, false otherwise
**/
native bool:TF2II_GetNamedItem( iItemDefinitionIndex, &Handle:hItem, iQuality = TF2ItemQuality_Unique, iLevel = 1 );

/**
* @brief Give item based on items_game.txt
*
* @param iClient Target
* @param iItemDefinitionIndex -
* @param iQuality (see TF2ItemQuality_ above)
* @param iLevel Item level (from 1 to 127)
*
* @return True on success, false otherwise
**/
native bool:TF2II_GiveNamedItem( iClient, iItemDefinitionIndex, iQuality = TF2ItemQuality_Unique, iLevel = 1 );

Links:
Changelog: http://files.xpenia....ourcemod/tf2ii/
Download: Plugin (Source code)
Includes: tf2itemsinfo.inc

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych