Fix for amb437
dod_set_user_kills & dod_set_user_score no longer have the dead scoreboard class side effect. dod_set_pl_deaths comment has been updated to reflect the side effect.
This commit is contained in:
parent
c5e36a4e3c
commit
2bc6d965f6
@ -154,6 +154,7 @@ static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
|
|||||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) = params[2];
|
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) = params[2];
|
||||||
|
|
||||||
if ( params[3]){
|
if ( params[3]){
|
||||||
|
/*
|
||||||
//ScoreShort message
|
//ScoreShort message
|
||||||
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
||||||
WRITE_BYTE(pPlayer->index);
|
WRITE_BYTE(pPlayer->index);
|
||||||
@ -162,6 +163,11 @@ static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
|
|||||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
||||||
WRITE_BYTE(1);
|
WRITE_BYTE(1);
|
||||||
MESSAGE_END();
|
MESSAGE_END();
|
||||||
|
*/
|
||||||
|
MESSAGE_BEGIN(MSG_ALL, gmsgObjScore);
|
||||||
|
WRITE_BYTE(pPlayer->index);
|
||||||
|
WRITE_SHORT(params[2]);
|
||||||
|
MESSAGE_END();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,7 +183,9 @@ static cell AMX_NATIVE_CALL set_user_frags(AMX *amx, cell *params){
|
|||||||
pPlayer->pEdict->v.frags = (float)params[2];
|
pPlayer->pEdict->v.frags = (float)params[2];
|
||||||
|
|
||||||
if ( params[3]){
|
if ( params[3]){
|
||||||
|
/*
|
||||||
//ScoreShort message
|
//ScoreShort message
|
||||||
|
|
||||||
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
||||||
WRITE_BYTE(pPlayer->index);
|
WRITE_BYTE(pPlayer->index);
|
||||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
|
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
|
||||||
@ -185,6 +193,11 @@ static cell AMX_NATIVE_CALL set_user_frags(AMX *amx, cell *params){
|
|||||||
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
||||||
WRITE_BYTE(1);
|
WRITE_BYTE(1);
|
||||||
MESSAGE_END();
|
MESSAGE_END();
|
||||||
|
*/
|
||||||
|
MESSAGE_BEGIN(MSG_ALL, gmsgFrags);
|
||||||
|
WRITE_BYTE(pPlayer->index);
|
||||||
|
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
|
||||||
|
MESSAGE_END();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -55,6 +55,8 @@ extern int gmsgScoreShort;
|
|||||||
extern int gmsgPTeam;
|
extern int gmsgPTeam;
|
||||||
extern int gmsgInitObj;
|
extern int gmsgInitObj;
|
||||||
extern int gmsgSetObj;
|
extern int gmsgSetObj;
|
||||||
|
extern int gmsgFrags;
|
||||||
|
extern int gmsgObjScore;
|
||||||
|
|
||||||
extern int iFGrenade;
|
extern int iFGrenade;
|
||||||
extern int iFRocket;
|
extern int iFRocket;
|
||||||
|
@ -56,6 +56,8 @@ int gmsgScoreShort;
|
|||||||
int gmsgPTeam;
|
int gmsgPTeam;
|
||||||
int gmsgInitObj;
|
int gmsgInitObj;
|
||||||
int gmsgSetObj;
|
int gmsgSetObj;
|
||||||
|
int gmsgFrags;
|
||||||
|
int gmsgObjScore;
|
||||||
|
|
||||||
struct sUserMsg {
|
struct sUserMsg {
|
||||||
const char* name;
|
const char* name;
|
||||||
@ -68,6 +70,8 @@ struct sUserMsg {
|
|||||||
{ "ScoreShort",&gmsgScoreShort,NULL,false },
|
{ "ScoreShort",&gmsgScoreShort,NULL,false },
|
||||||
{ "PTeam",&gmsgPTeam,NULL,false },
|
{ "PTeam",&gmsgPTeam,NULL,false },
|
||||||
{ "SetObj",&gmsgSetObj,Client_SetObj,false },
|
{ "SetObj",&gmsgSetObj,Client_SetObj,false },
|
||||||
|
{ "Frags",&gmsgFrags,NULL,false },
|
||||||
|
{ "ObjScore", &gmsgObjScore, NULL, false },
|
||||||
|
|
||||||
{ 0,0,0,false }
|
{ 0,0,0,false }
|
||||||
};
|
};
|
||||||
|
@ -49,7 +49,10 @@ native dod_is_randomclass(index);
|
|||||||
/* Returns player deaths */
|
/* Returns player deaths */
|
||||||
native dod_get_pl_deaths(index);
|
native dod_get_pl_deaths(index);
|
||||||
|
|
||||||
/* Sets player deaths. */
|
/* Sets player deaths.
|
||||||
|
* Note if you opt to refresh the scoreboard, it
|
||||||
|
* will make the player appear as "DEAD" in the scoreboard.
|
||||||
|
*/
|
||||||
native dod_set_pl_deaths(index,value,refresh=1);
|
native dod_set_pl_deaths(index,value,refresh=1);
|
||||||
|
|
||||||
/* Returns player deaths. */
|
/* Returns player deaths. */
|
||||||
|
Loading…
Reference in New Issue
Block a user