Back to my no sizeof() usage 😄

This commit is contained in:
Shavitush 2015-07-27 22:58:57 +03:00
parent b55120fcea
commit 9f88bf7f74
7 changed files with 69 additions and 73 deletions

24
1.2b_todo.md Normal file
View File

@ -0,0 +1,24 @@
# DONE
# Todo for 1.2b release
- [x] + create a github repo
shavit-core:
- [x] * make a better check of game engine instead of using a directory
- [x] + sm_pause
- [x] + sm_resume
- [x] + add natives/forwards for sm_pause/resume and polish code
shavit-misc:
- [x] + cvar "shavit_misc_godmode"
0 - nothing
1 - only world damage
2 - only player damage
3 - full godmode
- [x] + 250 maxspeed for every pistol
shavit-zones:
- [x] + player slaying zone
- [x] + cvar "shavit_zones_style"
0 - 3d (default)
1 - 2d

View File

@ -50,25 +50,16 @@ a bhop server should be simple
shavit-core - no other plugin will work without it.
shavit-zones - wouldn't really call it required but it's actually needed to get your timer to start/finish.
# Todo for 1.2b release < DONE!
- [x] + create a github repo
# Todo for 1.3b release
shavit-core:
- [x] * make a better check of game engine instead of using a directory
- [x] + sm_pause
- [x] + sm_resume
- [x] + add natives/forwards for sm_pause/resume and polish code
shavit-misc:
- [x] + cvar "shavit_misc_godmode"
0 - nothing
1 - only world damage
2 - only player damage
3 - full godmode
- [x] + 250 maxspeed for every pistol
- [x] + Handle freestyle zones
shavit-zones:
- [x] + player slaying zone
- [x] + cvar "shavit_zones_style"
0 - 3d (default)
1 - 2d
- [x] + Allow creation of freestyle zones
- [ ] + Make multiple freestyle zones possible (damn you Aoki and badges for making stuff difficult!)
- [ ] + Handle deletion of multiple freestyle zones
# Todo for 1.4b release
[NEW PLUGIN] shavit-stats:
[NEW PLUGIN] shavit-ranks:
[NEW PLUGIN] shavit-replay:

View File

@ -25,7 +25,7 @@
//#pragma newdecls required
#define SHAVIT_VERSION "1.2b"
#define SHAVIT_VERSION "1.3b"
#define PREFIX " \x04[Timer]\x01"
#define MAX_STYLES 2 // I could probably do sizeof(BhopStyle) but I suck
@ -47,13 +47,16 @@ enum BhopStyle(+=1)
};
// map zones
#define MULTIPLEZONES_LIMIT 16
enum MapZones(+=1)
{
Zone_Start = 0,
Zone_End,
Zone_Respawn,
Zone_Stop,
Zone_Slay
Zone_Slay,
Zone_Freestyle
};
// let's not throw errors k?
@ -222,7 +225,7 @@ native ServerGame Shavit_GetGameType();
* @param hSQL Handle to store the database on.
* @noreturn
*/
native void Shavit_GetDB(Handle &hSQL);
native void Shavit_GetDB(Database &hSQL);
/**
* (re)Starts the timer for a player.

View File

@ -116,9 +116,6 @@ public void OnPluginStart()
gH_Forwards_OnResume = CreateGlobalForward("Shavit_OnResume", ET_Event, Param_Cell);
// game types
char sGameName[64];
GetGameFolderName(sGameName, 64);
EngineVersion evType = GetEngineVersion();
if(evType == Engine_CSS)
@ -693,7 +690,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
bool bEdit = false;
// SW cheat blocking
if(gBS_Style[client] == Style_Sideways && !bOnLadder && (vel[1] != 0.0 || buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT))
if(!Shavit_InsideZone(client, Zone_Freestyle) && gBS_Style[client] == Style_Sideways && !bOnLadder && (vel[1] != 0.0 || buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT))
{
bEdit = true;

View File

@ -45,6 +45,14 @@ public void OnPluginStart()
CreateTimer(0.1, UpdateHUD_Timer, INVALID_HANDLE, TIMER_REPEAT);
}
public void OnConfigsExecuted()
{
if(gSG_Type == Game_CSS)
{
FindConVar("sv_hudhint_sound 0").SetBool(false);
}
}
public Action UpdateHUD_Timer(Handle Timer)
{
for(int i = 1; i <= MaxClients; i++)
@ -94,7 +102,7 @@ public void UpdateHUD(int client)
if(gSG_Type == Game_CSGO)
{
FormatEx(sHintText, 256, "<font size=\"18\">");
FormatEx(sHintText, 256, "<font size='18'>");
float fPB;
Shavit_GetPlayerPB(target, bsStyle, fPB);
@ -112,24 +120,24 @@ public void UpdateHUD(int client)
char sTime[32];
FormatSeconds(fTime, sTime, 32, false);
char sColor[16];
char sColor[8];
if(fTime < fWR || fWR == 0.0)
{
FormatEx(sColor, 16, "00FF00");
strcopy(sColor, 8, "00FF00");
}
else if(fPB != 0.0 && fTime < fPB)
{
FormatEx(sColor, 16, "FFA500");
strcopy(sColor, 8, "FFA500");
}
else
{
FormatEx(sColor, 16, "FF0000");
strcopy(sColor, 8, "FF0000");
}
Format(sHintText, 256, "%sTime: <font color=\"#%s\">%s</font>", sHintText, sColor, sTime);
Format(sHintText, 256, "%sTime: <font color='#%s'>%s</font>", sHintText, sColor, sTime);
}
float fSpeed[3];
@ -144,11 +152,11 @@ public void UpdateHUD(int client)
Format(sHintText, 256, "%s\tJumps: %d", sHintText, iJumps);
}
Format(sHintText, 256, "%s\nStyle: <font color=\"%s</font>", sHintText, bsStyle == Style_Forwards? "#797FD4\">Forwards":"#B54CB3\">Sideways");
Format(sHintText, 256, "%s\nStyle: <font color='%s</font>", sHintText, bsStyle == Style_Forwards? "#797FD4'>Forwards":"#B54CB3'>Sideways");
if(!bSpectating)
{
Format(sHintText, 256, "%s\tPlayer: <font color=\"#BF6821\">%N</font>", sHintText, target);
Format(sHintText, 256, "%s\tPlayer: <font color='#BF6821'>%N</font>", sHintText, target);
}
Format(sHintText, 256, "%s</font>", sHintText);
@ -191,9 +199,4 @@ public void UpdateHUD(int client)
}
PrintHintText(client, sHintText);
if(gSG_Type == Game_CSS)
{
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
}
}

View File

@ -400,7 +400,7 @@ public Action Command_Specs(int client, int args)
else
{
Format(sSpecs, 256, "%s, %N", sSpecs);
Format(sSpecs, 256, "%s, %N", sSpecs, i);
}
}
}

View File

@ -109,16 +109,7 @@ public void OnPluginStart()
RegAdminCmd("sm_deleterecords", Command_Delete, ADMFLAG_RCON, "Opens a record deletion menu interface");
RegAdminCmd("sm_deleteall", Command_DeleteAll, ADMFLAG_RCON, "Deletes all the records");
// late load
if(gB_Late)
{
for(int i = 1; i <= MaxClients; i++)
{
OnClientPutInServer(i);
}
OnAdminMenuReady(null);
}
OnAdminMenuReady(null);
}
public void OnAdminMenuReady(Handle topmenu)
@ -204,30 +195,7 @@ public void OnClientPutInServer(int client)
return;
}
// when I test this plugin, I late load. and it won't return any rows if I don't delay it when I late load so idk ;-;
if(gB_Late)
{
CreateTimer(0.01, Timer_DelayedCache, GetClientSerial(client));
}
else
{
UpdateClientCache(client);
}
}
public Action Timer_DelayedCache(Handle Timer, any data)
{
int client = GetClientFromSerial(data);
if(!client)
{
return Plugin_Handled;
}
UpdateClientCache(client);
return Plugin_Handled;
}
public void UpdateClientCache(int client)
@ -881,6 +849,16 @@ public void SQL_CreateTable_Callback(Handle owner, Handle hndl, const char[] err
return;
}
if(gB_Late)
{
for(int i = 1; i <= MaxClients; i++)
{
OnClientPutInServer(i);
}
gB_Late = false;
}
}
public any abs(any thing)