-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the VSH-Advanced wiki!
When writing Sub-Plugins, take a look at the vsha-saxtonhale.sp for full reference.
I have created this page as a quick reference for some private forwards sent to the subplugins.
// VSHA Events
enum VSHA_Var {
hString,
EventTime,
EventOnPrepBoss,
EventSound,
EventModelTimer,
EventModel,
EventBoss,
EventClient,
EventTarget,
EventAttacker,
EventVictim,
EventHitPoints,
EventArg1, //generic vsha event arguments
EventArg2,
EventArg3,
EventArg4,
SmEvent, ///usual game events from sm hooked events
}
List of Private Forwards to each sub-plugin:
/* BEGIN GLOBAL VARS */ retrieves specified values from the main VSHA plugin, see VSHA_Var enum in constants.inc, only those values are allowed this mostly used for accessing a variable without creating a special native just for it this returns any:, you should tag it if return value is not suppose to be normal integer. to get integer.. do this: view_as(VSHA_GetVar(EventArg1)); or view_as(VSHA_GetVar(EventArg1)); most are temporary variables and this function should be called immidiately in the right functions examples VSHA_GetVar(EventArg1) VSHA_GetVar(EventArg2) See VSHA_Var enum in constants to get a list Do not get/set vars arbitrarily unless you know what you are doing
native any VSHA_GetVar(VSHA_Var variabletoretrieve);
native void VSHA_SetVar(VSHA_Var variabletoretrieve, any value);
/* END GLOBAL VARS */
These do not have any variables past to them:
public Action VSHA_OnBossIntroTalk() {};
public Action VSHA_OnLastSurvivor() {};
public Action VSHA_MessageTimer() {};
These have variables past to them, and some of them can be modified.
Examples on code:
public Action VSHA_OnPlayerKilledByBoss() {
int iiBoss = VSHA_GetVar(EventBoss);
int attacker = VSHA_GetVar(EventAttacker);
};
public Action VSHA_OnKillingSpreeByBoss() {
int iiBoss = VSHA_GetVar(EventBoss);
int attacker = VSHA_GetVar(EventAttacker);
};
public Action VSHA_OnBossKilled() { //victim is boss
int iiBoss = VSHA_GetVar(EventBoss);
int attacker = VSHA_GetVar(EventAttacker);
}
public Action VSHA_OnBossWin() {
//Event event = VSHA_GetVar(SmEvent);
int iiBoss = VSHA_GetVar(EventBoss);
}
public Action VSHA_OnBossKillBuilding() {
Event event = VSHA_GetVar(SmEvent);
int building = event.GetInt("index");
int attacker = VSHA_GetVar(EventAttacker);
}
public Action VSHA_OnBossAirblasted() {
int iiBoss = VSHA_GetVar(EventBoss);
int airblaster = VSHA_GetVar(EventAttacker);
}
public Action VSHA_OnBossSelected() {
int iiBoss = VSHA_GetVar(EventClient);
}
public Action VSHA_OnBossSetHP() {
int iClient = VSHA_GetVar(EventClient);
}
public Action VSHA_OnBossTimer() {
int iClient = VSHA_GetVar(EventClient);
}
public Action VSHA_OnPrepBoss() {
int iClient = VSHA_GetVar(EventOnPrepBoss);
}
public Action VSHA_OnMusic() {
char BossTheme[256];
float time;
switch ( GetRandomInt(0, 2) )
{
case 0:
{
BossTheme = HaleTheme1;
time = 150.0;
}
case 1:
{
BossTheme = HaleTheme2;
time = 150.0;
}
case 2:
{
BossTheme = HaleTheme3;
time = 220.0;
}
}
StringMap SoundMap = new StringMap();
SoundMap.SetString("Sound", BossTheme);
VSHA_SetVar(EventSound,SoundMap);
VSHA_SetVar(EventTime,time);
return Plugin_Continue;
}
public Action VSHA_OnModelTimer() {
int iClient = VSHA_GetVar(EventModelTimer);
char modelpath[PATHX];
//DP("VSHA_OnModelTimer");
if (iClient != Hale[iClient])
{
SetVariantString("");
AcceptEntityInput(iClient, "SetCustomModel");
return Plugin_Stop;
}
modelpath = HaleModel;
StringMap ModelMap = new StringMap();
ModelMap.SetString("Model", modelpath);
VSHA_SetVar(EventModel,ModelMap);
SetVariantString(modelpath);
AcceptEntityInput(iClient, "SetCustomModel");
SetEntProp(iClient, Prop_Send, "m_bUseClassAnimations", 1);
return Plugin_Continue;
}
public Action VSHA_OnBossRage() {
int iClient = VSHA_GetVar(EventBoss);
}