Quote:
Originally Posted by Kailo
Error has reference to line, what line?
I think error occur because you don't create callback function.
|
Code:
#include <sdktools_gamerules>
#include <sdktools_sound>
#include <sdkhooks>
#pragma semicolon 1
int inDash[MAXPLAYERS+1];
Handle h_gCvarRoundtime = INVALID_HANDLE;
Handle RoundTimer = INVALID_HANDLE;
public void OnPluginStart()
{
HookEvent("teamplay_round_win", OnRoundWin);
HookEvent("teamplay_round_stalemate", OnRoundStalemate);
HookEvent("teamplay_round_start", OnRoundStart);
HookEvent("player_spawn", OnPlayerSpawn);
h_gCvarRoundtime = CreateConVar("CvarRoundtime", "9000.0");
}
public void OnClientConnected(int client)
{
SDKHook(client, SDKHook_GroundEntChangedPost, OnGroundChange);
}
public void OnGroundChange(int entity)
{
if (IsClientInGame(entity))
{
if (IsPlayerAlive(entity))
{
if (inDash[entity] == 0)
{
inDash[entity] = 1;
{
else
{
inDash[entity] = 0;
}
}
}
}
public Action OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int SpawnedPlayer = GetClientOfUserId(GetEventInt (event, "userid", 0));
if (GetEntityFlags(client) & FN_ONGROUND)
{
inDash[client] = 0;
}
else
{
inDash[client] = 1;
}
}
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
RoundTimer = CreateTimer(GetConVarFloat(h_gCvarRoundtime), TimerRound);
if (IsSoundPrecached("vo/announcer_you_must_not_fail_this_time.wav"))
{
EmitSoundToAll("vo/announcer_you_must_not_fail_this_time.wav", _, _, SNDLEVEL_RAIDSIREN, _, SNDVOL_NORMAL, _, _, _, _, _, _);
}
PrintToChatAll("You must not fail this time!");
}
public Action TimerRound(Handle timer, Handle hndl)
{
GameRules_SetPropString("m_iRoundState", "Roundstate_Stalemate");
}
public Action OnRoundStalemate(Event event, const char[] name, bool dontBroadcast)
{
KillTimer(RoundTimer);
}
public Action OnRoundWin(Event event, const char[] name, bool dontBroadcast)
{
KillTimer(RoundTimer);
}
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
{
float clientOrigin[3];
if (IsClientInGame(client))
{
if (IsPlayerAlive(client) && !(GetEntityFlags(client) & FN_ONGROUND))
{
if (GetClientButtons(client) & IN_JUMP)
{
if (inDash[client] == 0)
{
inDash[client]++;
GetClientAbsOrigin(client, clientOrigin);
PushClient(client, clientOrigin);
}
}
}
}
}
stock PushClient(client, float ClientEyeAngles[3])
{
float movementVector[3];
float changedVelocity[3];
GetAngleVectors(ClientEyeAngles, movementVector, NULL_VECTOR, NULL_VECTOR);
NormalizeVector(movementVector, movementVector);
ScaleVector(movementVector, distanceScale);
Entity_GetAbsVelocity(client, changedVelocity);
for (int i = 0; i < 3; i++)
{
switch (i)
{
case 1:
{
changedVelocity[i] += movementVector
2 (changedVelocity[i]);
case 2:
{
changedVelocity[i] += movementVector
2 (changedVelocity[i]);
case 3:
{
changedVelocity[i] = 0.0;
changedVelocity[i] += movementVector[i];
}
}
Entity_SetAbsVelocity(client, changedVelocity);
}
Your plugin failed to compile! Read the errors below:
SourcePawn Compiler 1.7.1
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC
/groups/sourcemod/upload_tmp/textz1T9TF.sp(10) : error 017: undefined symbol "OnRoundWin"
/groups/sourcemod/upload_tmp/textz1T9TF.sp(11) : error 017: undefined symbol "OnRoundStalemate"
/groups/sourcemod/upload_tmp/textz1T9TF.sp(12) : error 017: undefined symbol "OnRoundStart"
/groups/sourcemod/upload_tmp/textz1T9TF.sp(13) : error 017: undefined symbol "OnPlayerSpawn"