diff --git a/dlls/dod2/dodfun/NBase.cpp b/dlls/dod2/dodfun/NBase.cpp index 807170ea..2f688d26 100755 --- a/dlls/dod2/dodfun/NBase.cpp +++ b/dlls/dod2/dodfun/NBase.cpp @@ -97,30 +97,10 @@ static cell AMX_NATIVE_CALL nade_set_fuse(AMX *amx, cell *params){ // id,(re)set return 0; } -static cell AMX_NATIVE_CALL dod_get_wpninfo(AMX *amx, cell *params){ // id - int index = params[1]; - if (index<1||index>gpGlobals->maxClients){ - MF_RaiseAmxError(amx,AMX_ERR_NATIVE); - return 0; - } - CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); - - //weapon_data_t wdata; - - //mm_DispatchThink(pPlayer->pEdict); - //mm_GetWeaponData(pPlayer->pEdict,&wdata); - - //MF_PrintSrvConsole("%d \n",wdata.iuser1); - - return 1; -} - AMX_NATIVE_INFO base_Natives[] = { { "dod_set_stamina", set_player_stamina }, { "dod_set_fuse", nade_set_fuse }, - { "dod_get_wpninfo", dod_get_wpninfo }, - ///******************* { NULL, NULL } }; \ No newline at end of file diff --git a/dlls/dod2/dodfun/NPD.cpp b/dlls/dod2/dodfun/NPD.cpp index 00d07d62..cfcaf53b 100755 --- a/dlls/dod2/dodfun/NPD.cpp +++ b/dlls/dod2/dodfun/NPD.cpp @@ -132,13 +132,13 @@ static cell AMX_NATIVE_CALL get_user_deaths(AMX *amx, cell *params){ int index = params[1]; if (index<1||index>gpGlobals->maxClients){ MF_RaiseAmxError(amx,AMX_ERR_NATIVE); - return 0; + return -1; } CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); if (pPlayer->ingame){ return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ); } - return 0; + return -1; } static cell AMX_NATIVE_CALL set_user_deaths(AMX *amx, cell *params){ @@ -190,6 +190,45 @@ static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){ return 1; } +static cell AMX_NATIVE_CALL set_user_frags(AMX *amx, cell *params){ + int index = params[1]; + if (index<1||index>gpGlobals->maxClients){ + MF_RaiseAmxError(amx,AMX_ERR_NATIVE); + return 0; + } + CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); + + if (pPlayer->ingame){ + pPlayer->pEdict->v.frags = (float)params[2]; + + if ( params[3]){ + //ScoreShort message + MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort); + WRITE_BYTE(pPlayer->index); + WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) ); + WRITE_SHORT((int)pPlayer->pEdict->v.frags); + WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) ); + WRITE_BYTE(1); + MESSAGE_END(); + } + } + return 1; +} + +static cell AMX_NATIVE_CALL get_user_frags(AMX *amx, cell *params){ + int index = params[1]; + if (index<1||index>gpGlobals->maxClients){ + MF_RaiseAmxError(amx,AMX_ERR_NATIVE); + return -1; + } + CPlayer* pPlayer = GET_PLAYER_POINTER_I(index); + + if (pPlayer->ingame) + return (int)pPlayer->pEdict->v.frags; + + return -1; +} + static cell AMX_NATIVE_CALL set_user_teamname(AMX *amx, cell *params){ int index = params[1]; if (index<1||index>gpGlobals->maxClients){ @@ -487,6 +526,9 @@ AMX_NATIVE_INFO pd_Natives[] = { { "dod_get_user_ammo", get_user_ammo }, { "dod_set_user_ammo", set_user_ammo }, + { "dod_get_user_kills", get_user_frags }, + { "dod_set_user_kills", set_user_frags }, + { "dod_test_pd", test_pd }, ///******************* { NULL, NULL } diff --git a/plugins/include/dodfun.inc b/plugins/include/dodfun.inc index 8d9b6b7f..3d17705a 100755 --- a/plugins/include/dodfun.inc +++ b/plugins/include/dodfun.inc @@ -41,6 +41,12 @@ native dod_get_pl_deaths(index); /* Sets player deaths. */ native dod_set_pl_deaths(index,value,refresh=1); +/* Returns player deaths. */ +native dod_get_user_kills(index); + +/* Sets player kills. */ +native dod_set_user_kills(index,value,refresh=1); + /* Sets player score. */ native dod_set_user_score(index,value,refresh=1);