|
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
|

05-21-2010
, 17:09
call a stock from a stock (custom stocks)
|
#1
|
no, I am not in love with the word stock.. I am working on converting a plugin from c++ to AMXX language (pawn?, lol)
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
/********************************
Begin Defines
********************************/
#define PLUGIN "TFC Tech"
#define VERSION "0.1"
#define AUTHOR "Master"
#define TECH_LEVELS 6
#define TECHS_PER_LEVEL 4
#define MAX_TEAMS 4
#define VOTE_TIME 20 // seconds to vote
#define SENTRY_BASE_OFFSET_Z 21.2 // sentry is this many units up from base
#define TECH_SCOUT_SPEED 0,0
#define TECH_RAILGUN_BLAST 0,1
#define TECH_BLUEPIPE 0,2
#define TECH_SPY_INVIS 0,3
#define TECH_AP_NAILS 1,0
#define TECH_SENTRY_PUSH 1,1
#define TECH_FLAG_TELEPORT 1,2
#define TECH_FAKE_FLAGS 1,3
#define TECH_STICKY_PIPES 2,0
#define TECH_CALTROP_INVIS 2,1
#define TECH_PYRO_ARMOR 2,2
#define TECH_WATER_BREATH 2,3
#define TECH_SPAWN_INVINC 3,0
#define TECH_DEATH_EXP 3,1
#define TECH_HW_FASTFIRE 3,2
#define TECH_ROCKET_DET 3,3
#define TECH_ADRENALINE 4,0
#define TECH_FLAG_THROW 4,1
#define TECH_NAIL_PUSH 4,2
#define TECH_FEIGN_REGEN 4,3
#define TECH_REGEN 5,0
#define TECH_RAGE 5,1
#define TECH_FLAG_RESTOCK 5,2
#define TECH_ANTIGRAV 5,3
#define FAST_SCOUT_SPEED 500
#define RAGE_QUAD_TIME 10
#define NAIL_PUSH_SPEED 800
#define GRAVITY_PROPORTION 0.1
#define AP_NAIL_BONUS 7
#define CALTROP_RENDERAMT 0
#define SHOCKWAVE_NAIL_COST 4
#define SHOCKWAVE_ENGY_ARMOR_COST 10
#define IMPLANT_DAMAGE 250
#define REGEN_RATE 2
#define FEIGN_REGEN_RATE 5
#define SPY_CLOAK_TIME 1
#define FLAG_TELEPORT_DELAY 1
#define FLAG_TELEPORT_H 50
#define FLAG_TELEPORT_A 100
#define PYRO_REGEN_RATE 5
#define PYRO_ARMOR_TYPE 0.8
#define SPAWN_INVINC_TIME 8
#define ANTIGRAV_DAMAGE 3
#define MAX_ENTITIES 1024
#define MAX_PLAYERS 32
#define NULL 0
/********************************
End Defines
********************************/
/********************************
Begin Global Defines
********************************/
new m_LaserBeam, m_Shockwave, m_Lightning, m_XenoBeam, m_Bubble, m_Smoke, m_Fizz
new iNumberOfTeams; // the number of teams in this map
new iHighestMapTeam; // the highest team value for an info_player_teamspawn
new bool:bWasDead[MAX_PLAYERS]; // the old deadflag status, used to determine if the player just respawned
new Float:fLastHudUpdate[MAX_PLAYERS]; // timer for updating the text on player huds
new iLastTeam[MAX_PLAYERS]; // the last team the player was on when they respawned
new Float:fLastHealth[MAX_PLAYERS]; // health of the player at last Think
new Float:fLastArmor[MAX_PLAYERS]; // armor of the player at last Think
new Float:vecLastDamageOrigin[MAX_PLAYERS][3]; // the last origin from which a damage message was sent
new iNewEnts[MAX_ENTITIES];
new iNewEntCount;
new Float:fTechVoteTime[TECH_LEVELS];
new szTechName[TECH_LEVELS][TECHS_PER_LEVEL][256]; // the name of each tech
new szTechText[TECH_LEVELS][TECHS_PER_LEVEL][1024]; // the text that appears when you gain that tech
new bool:bInVote; // are we currently in a vote?
new bool:bPlayerVoted[MAX_PLAYERS]; // which players have voted in the current vote
new Float:fVoteStartTime; // the time the current vote started
new iCurrentTechLevel; // what tech level are we voting on
new iVotesForTech[TECH_LEVELS][TECHS_PER_LEVEL][MAX_TEAMS];
new bool:bGotTech[TECH_LEVELS][TECHS_PER_LEVEL][MAX_TEAMS];
// variables used in techs
new Float:fLastMoveTime[MAX_PLAYERS]; // the time the player stopped moving
new Float:fLastSecondTick[MAX_PLAYERS]; // used to set a bool for things that should be done every second
new Float:vecDeathLocation[MAX_PLAYERS][3];
new Float:fHeldUseTime[MAX_PLAYERS]; // the time the player started holding the USE key
new bool:bFlagWasHeld[MAX_ENTITIES]; // was the flag with this index being held last frame?
new iFlagLastTeam[MAX_ENTITIES]; // the last team to hold this flag
//edict_t *pSentryPair[MAX_ENTITIES]; // used to pair up sentries and sentry bases
new pSentryPair[MAX_ENTITIES];
/********************************
End Global Defines
********************************/
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_precache()
{
// store the indices of spries, so we can use them with messages
m_LaserBeam = precache_model("sprites/laserbeam.spr");
m_Shockwave = precache_model("sprites/shockwave.spr");
m_Lightning = precache_model("sprites/lgtning.spr");
m_XenoBeam = precache_model("sprites/xenobeam.spr");
m_Bubble = precache_model("sprites/bubble.spr");
m_Smoke = precache_model("sprites/smoke.spr");
m_Fizz = precache_model("sprites/bhit.spr");
// don't bother storing indices of models and sounds
//precache_model("models/presentlg.mdl");
//precache_model("models/presentsm.mdl");
precache_model("models/invis.mdl");
precache_model("models/rpgrocket.mdl");
precache_model("models/can.mdl");
precache_sound("buttons/blip1.wav");
precache_sound("items/medshot4.wav");
precache_sound("items/gunpickup2.wav");
precache_sound("items/inv1.wav");
precache_sound("player/heartbeat1.wav");
precache_sound("items/damage.wav");
precache_sound("items/airtank1.wav");
precache_sound("items/suitchargeok1.wav");
precache_sound("weapons/grenade_hit1.wav");
precache_sound("weapons/grenade_hit2.wav");
precache_sound("weapons/grenade_hit3.wav");
precache_sound("weapons/mine_charge.wav");
precache_sound("debris/beamstart7.wav");
//precache_sound("vox/no.wav");
precache_sound("turret/tu_spinup.wav");
Initialize(); // reset variables for new map
}
stock Initialize()
{
{
new i, j;
for(i = 0; i < MAX_PLAYERS; i++)
{
InitializePlayer(i+1);
}
iNewEntCount = 0;
for(i = 0; i < MAX_ENTITIES; i++)
{
iNewEnts[i] = 0;
bFlagWasHeld[i] = false;
iFlagLastTeam[i] = 0;
pSentryPair[i] = NULL;
}
iNumberOfTeams = 4; // 4 is default in case of no info_tfdetect entity (hldm maps)
iHighestMapTeam = 0; // incremented whenver an info_player_teamspawn with higher team is found
fTechVoteTime[0] = 2.0;
fTechVoteTime[1] = 5.0;
fTechVoteTime[2] = 10.0;
fTechVoteTime[3] = 15.0;
fTechVoteTime[4] = 20.0;
fTechVoteTime[5] = 25.0;
/*
fTechVoteTime[0] = .2;
fTechVoteTime[1] = .5;
fTechVoteTime[2] = .10;
fTechVoteTime[3] = .15;
fTechVoteTime[4] = .20;
fTechVoteTime[5] = .25;
*/
bInVote = false;
fVoteStartTime = 0.0; // the time the current vote started
iCurrentTechLevel = 0; // what tech level are we voting on
for(i = 0; i < TECH_LEVELS; i++)
{
for(j = 0; j < TECHS_PER_LEVEL; j++)
{
strcpy(szTechName[i][j], "(undefined tech)");
strcpy(szTechText[i][j], "(undefined tech text)");
iVotesForTech[i][j][0] = 0;
iVotesForTech[i][j][1] = 0;
iVotesForTech[i][j][2] = 0;
iVotesForTech[i][j][3] = 0;
bGotTech[i][j][0] = false;
bGotTech[i][j][1] = false;
bGotTech[i][j][2] = false;
bGotTech[i][j][3] = false;
}
}
copy(szTechName[0][0], 255, "Fast Scouts");
copy(szTechName[0][1], 255, "Railgun Shockwave");
copy(szTechName[0][2], 255, "Stronger Blue Pipes");
copy(szTechName[0][3], 255, "Spy Cloaking");
copy(szTechText[0][0], 255, "Scouts on your team are now faster.");
copy(szTechText[0][1], 255, "Your railguns now cause a shockwave on impact.");
copy(szTechText[0][2], 255, "Your blue pipebombs now do more damage when they explode.");
copy(szTechText[0][3], 255, "Spies on your team can become invisible by standing still.");
copy(szTechName[1][0], 255, "Armor Piercing Nails");
copy(szTechName[1][1], 255, "Movable Sentry Guns");
copy(szTechName[1][2], 255, "Defensive Flag Teleport");
copy(szTechName[1][3], 255, "Decoy Flags");
copy(szTechText[1][0], 255, "Your nailguns now do extra damage which bypasses armor.");
copy(szTechText[1][1], 255, "Engineers on your team can now push sentries with the USE key.");
copy(szTechText[1][2], 255, "Soldiers with enough health can hold USE to teleport to their flag on some maps.");
copy(szTechText[1][3], 255, "When the enemy drops the flag, it will throw out several decoys.");
copy(szTechName[2][0], 255, "Sticky Pipebombs");
copy(szTechName[2][1], 255, "Invisible Caltrops");
copy(szTechName[2][2], 255, "Improved Pyro Armor");
copy(szTechName[2][3], 255, "Underwater Breathing");
copy(szTechText[2][0], 255, "Your team's pipebombs can now be stuck to walls and ceilings.");
copy(szTechText[2][1], 255, "Your caltrops will blend in to whatever surface they land on.");
copy(szTechText[2][2], 255, "Pyros on your team now have drastically improved armor.");
copy(szTechText[2][3], 255, "Players on your team can now breathe water.");
copy(szTechName[3][0], 255, "Respawn Immunity");
copy(szTechName[3][1], 255, "Explosive Implants");
copy(szTechName[3][2], 255, "Fast Firing HWGuys");
copy(szTechName[3][3], 255, "Dettable Rockets");
copy(szTechText[3][0], 255, "Medics, scout, spies, pyros and demomen are invincible for a few seconds after spawning.");
copy(szTechText[3][1], 255, "Scouts, medics, demomen and pyros on your team now deal damage after death.");
copy(szTechText[3][2], 255, "Heavy Weapon Guys on your team can now move normally while firing.");
copy(szTechText[3][3], 255, "Soldiers can press USE to detonate their rockets early.");
copy(szTechName[4][0], 255, "Adrenaline Speed Burst");
copy(szTechName[4][1], 255, "Improved Flag Throw");
copy(szTechName[4][2], 255, "Knockback Supernailgun");
copy(szTechName[4][3], 255, "Feign Regeneration");
copy(szTechText[4][0], 255, "After losing enough health, players on your team gain a speed boost.");
copy(szTechText[4][1], 255, "Players on your team can throw the flag a lot further.");
copy(szTechText[4][2], 255, "The supernailguns of your medics now cause knockback on impact.");
copy(szTechText[4][3], 255, "While feigned, your spies will regenerate health and armor.");
copy(szTechName[5][0], 255, "Regeneration");
copy(szTechName[5][1], 255, "Soldier Quad Rage");
copy(szTechName[5][2], 255, "Flag Touch Restock");
copy(szTechName[5][3], 255, "Antigravity");
copy(szTechText[5][0], 255, "Players on your team will regenerate health.");
copy(szTechText[5][1], 255, "For a short time after killing someone with a rocket, your soldiers will deal quad damage.");
copy(szTechText[5][2], 255, "Medics and scouts will regain some health, armor and concs when they take the flag.");
copy(szTechText[5][3], 255, "Unless you're a soldier or engineer, you can press the USE key to toggle low gravity.");
}
stock InitializePlayer(index)
{
index -= 1; // assume ent index is passed
bWasDead[index] = true; // assume all players are dead before they spawn for the first time
fLastHudUpdate[index] = 0;
iLastTeam[index] = 0;
vecDeathLocation[index] = Vector(0, 0, -4096); // way down below the map so that death explosion is invisible
bPlayerVoted[index] = false;
fLastMoveTime[index] = 0;
fLastSecondTick[index] = 0;
fHeldUseTime[index] = 0;
fLastHealth[index] = 0;
fLastArmor[index] = 0;
vecLastDamageOrigin[index][] ={
0,
0,
0
}
}
and yes, I know thats not my only problem
__________________
|
|