A plugin I made just kinda screwing around. Some of the stuff is a bit hard to find so i figured it could be rather useful.
More than anything this is to show off the include i made.
Commands:
- sm_setbreinf <amount> - Set BE Reinforcements/Tickets.
- sm_setnreinf <amount> - Set NF Reinforcements/Tickets.
- sm_givebreinf <amount> - Adds BE Reinforcements/Tickets.
- sm_givenreinf <amount> - Adds NF Reinforcements/Tickets.
- sm_setbres <amount> - Set BE Resources.
- sm_setnres <amount> - Set NF Resources.
- sm_givebres <amount> - Adds BE Resources.
- sm_givenres <amount> -Adds NF Resources.
- sm_getbres - Print BE Resources to Admin In Chat.
- sm_getnres - Print NF Resources to Admin In Chat.
- sm_uticks <0|1> - Give Unlimited tickets to both sides.
- sm_ubticks <0|1> - Give Unlimited tickets to BE.
- sm_unticks <0|1> - Give Unlimited tickets to NF.
- sm_ures <0|1> - Give Unlimited resources to both sides.
- sm_ubres <0|1> - Give Unlimited resources to BE.
- sm_unres <0|1> - Give Unlimited resources to NF.
Seeing how these commands have a massive effect on the game the commands are defaulted to root access only.
For those coders out there i made an include with a bunch of stocks....
just at the top of you plugin put...
and make sure the empires.inc file is in the includes directory in the compiler folder.
API 1.2 RELEASED!
Code:
/*
* Empires API
*
* Created By Theowningone
* Version: 1.2
* http://www.theowningone.info/
* http://www.borgamers.com/
*/
/********************
* --> Is Stocks <-- *
********************/
/**
* Is Player Squad Leader
*
* @param client Client Index
* @return 1 if leader, 0 if other
*/
stock IsSquadLeader(client)
/**
* Is Player Commander
*
* @param client Client Index
* @return 1 if comm, 0 if other
*/
stock IsComm(client)
/**
* Is Player In Vehicle
*
* @param client Client Index
* @return 1 if in vehicle, 0 if not
*/
stock IsInVehicle(client)
/**********************
* --> Team Stocks <-- *
**********************/
/**
* Retrieves NF Resources.
*
* @return NF Resources
*/
stock GetNFResources()
/**
* Sets NF Resources.
*
* @noreturn
*/
stock SetNFResources(amount)
/**
* Retrieves BE Resources.
*
* @return BE Resources
*/
stock GetBEResources()
/**
* Sets BE Resources.
*
* @noreturn
*/
stock SetBEResources(amount)
/**
* Retrieves NF Reinforcements
*
* @return NF Reinforcements
*/
stock GetNFReinforcements()
/**
* Sets NF Reinforcements
*
* @noreturn
*/
stock SetNFReinforcements(amount)
/**
* Retrieves BE Reinforcements
*
* @return BE Reinforcements
*/
stock GetBEReinforcements()
/**
* Sets BE Reinforcements
*
* @noreturn
*/
stock SetBEReinforcements(amount)
/**
* Is Researched
*
* @param team Team Index
* @param index Research Index
* @return 1 if researched, 0 if not
*/
stock IsResearched(team, index)
/**
* Current Research
*
* @param team Team Index
* @return Research Index
*/
stock CurrentResearch(team)
/**
* Current Research Name
*
* @param team Team Index
* @param buffer Buffer to hold the research name
* @param size Len of the buffer
* @return Research Index
*/
stock CurrentResearchName(team, String:buffer[], size)
/**
* Set Research
*
* @param team Team Index
* @param index Research Index
* @param status weather to research or not
* @noreturn
*/
stock SetResearch(team, index, bool:status)
/*************************
* --> Vehicle Stocks <-- *
*************************/
/**
* Get Vehicle Occupants
*
* @param ent Vehicle Entity Index
* @return Amount of clients in vehicle
*/
stock GetVehicleOccupants(ent)
/**
* Get Vehicle Driver
*
* @param ent Vehicle Entity Index
* @return Client Index of Driver (0 if none, -1 if invalid entity)
*/
stock GetVehicleDriver(ent)
/**
* Set Vehicle Armor
*
* @param ent Vehicle Entity Index
* @param side side of armor (1 is front, 2 is back, 3 is left, 4 is right)
* @param front Health to set armor to
* @return -1 on error, 0 on success
*/
stock SetVehicleArmor(ent, side, Float:health)
/**
* Get Vehicle Armor
*
* @param ent Vehicle Entity Index
* @param side side of armor (1 is front, 2 is back, 3 is left, 4 is right)
* @return Armor Health (-1.0 on error)
*/
stock Float:GetVehicleArmor(ent, side)
/**
* Set Vehicle Hull
*
* @param ent Vehicle Entity Index
* @param health Health to set hull to
* @return -1 on error, 0 on success
*/
stock SetVehicleHull(ent, Float:health)
/**
* Get Vehicle Hull
*
* @param ent Vehicle Entity Index
* @return Hull Health (-1.0 on error)
*/
stock Float:GetVehicleHull(ent)
/**
* Set Vehicle Heat
*
* @param ent Vehicle Entity Index
* @param heat Heat to set for vehicle
* @return -1 on error, 0 on success
*/
stock SetVehicleHeat(ent, Float:heat)
/**
* Get Vehicle Heat
*
* @param ent Vehicle Entity Index
* @return Vehicle Heat (-1.0 on error)
*/
stock Float:GetVehicleHeat(ent)
/**
* Get Vehicle Class
*
* @param ent Vehicle Entity Index
* @return Vehicle Class (-1 on error)
*/
stock GetVehicleClass(ent)
/**
* Get Vehicle Class Name
*
* @param ent Vehicle Entity Index
* @param buffer Buffer to hold the vehicle class name
* @param size Len of the buffer
* @return Vehicle Class (-1 on error)
*/
stock GetVehicleClassName(ent, String:buffer[], size)
/**
* Get Client Vehicle
*
* @param client Client Index
* @return Client Vehicle Entity Index (-1 is error, 0 is none)
*/
stock GetPlayerVehicle(client)
/**
* Get Cannon Entity
*
* @param ent Vehicle Entity Index
* @return Cannon Entity Index
*/
stock GetCannonEnt(ent)
/**
* Get Turret Entity
*
* @param ent Vehicle Entity Index
* @return Turret Entity Index
*/
stock GetTurretEnt(ent)
/**********************
* --> Misc Stocks <-- *
**********************/
/**
* Retrieves a player's squad number
*
* @param client Client Index
* @return Player squad index (0 is none)
*/
stock GetPlayerSquadNum(client)
/**
* Retrieves a player's squad name
*
* @param client Client Index
* @param buffer Buffer to hold the squad name
* @param size Len of the buffer
* @return Player squad index
*/
stock GetPlayerSquadName(client, String:buffer[], size)
/**
* Retrieves a player's score
*
* @param client Client Index
* @return Player score
*/
stock GetPlayerScore(client)
/**
* Retrieves a player's class
*
* @param client Client Index
* @return Player class (0 is scout, 1 is rifleman, 2 is gren, 3 is engy, 5 is spec)
*/
stock GetPlayerClassNum(client)
/**
* Retrieves a player's class
*
* @param client Client Index
* @param buffer Buffer to hold the class name
* @param size Len of the buffer
* @return Player class index
*/
stock GetPlayerClassName(client, String:buffer[], size)