bye bye WON ..

This commit is contained in:
Lukasz Wlasinksi
2004-07-28 17:06:01 +00:00
parent 2fb9a5d4b5
commit 7801cde7f0
11 changed files with 41 additions and 131 deletions

View File

@ -46,23 +46,12 @@ static cell AMX_NATIVE_CALL set_user_class(AMX *amx, cell *params){
if (iClass){
if ( bSteam ){
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_CLASS) = iClass;
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 0; // disable random class
}
else {
*( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_CLASS) = iClass;
*( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_RCLASS) = 0; // disable random class
}
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_CLASS) = iClass;
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 0; // disable random class
}
else {
if ( bSteam ){
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 1; // set random class
}
else {
*( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_RCLASS) = 1; // set random class
}
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 1; // set random class
}
return 1;
@ -96,10 +85,7 @@ static cell AMX_NATIVE_CALL set_user_team(AMX *amx, cell *params){
break;
}
if ( bSteam )
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 1; // set random class
else
*( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_RCLASS) = 1; // set random class
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS) = 1; // set random class
if ( params[3] ){
MESSAGE_BEGIN(MSG_ALL,gmsgPTeam);
@ -122,10 +108,7 @@ static cell AMX_NATIVE_CALL get_user_nextclass(AMX *amx, cell *params){
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if ( pPlayer->ingame ){
if ( bSteam )
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_CLASS);
else
return *( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_CLASS);
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_CLASS);
}
return 0;
@ -140,10 +123,7 @@ static cell AMX_NATIVE_CALL is_randomclass(AMX *amx, cell *params){
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if ( pPlayer->ingame ){
if ( bSteam )
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS);
else
return *( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_RCLASS);
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_RCLASS);
}
return 0;
}
@ -156,10 +136,7 @@ static cell AMX_NATIVE_CALL get_user_deaths(AMX *amx, cell *params){
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if (pPlayer->ingame){
if ( bSteam )
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS );
else
return *( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_DEATHS );
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS );
}
return 0;
}
@ -172,18 +149,12 @@ static cell AMX_NATIVE_CALL set_user_deaths(AMX *amx, cell *params){
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if (pPlayer->ingame){
if ( bSteam )
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) = params[2];
else
*( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_DEATHS ) = params[2];
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) = params[2];
if ( params[3]){
//ScoreShort message
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
WRITE_BYTE(pPlayer->index);
if ( bSteam )
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
else
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_SCORE ) );
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
WRITE_SHORT(params[2]);
WRITE_BYTE(1);
@ -202,20 +173,15 @@ static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if (pPlayer->ingame){
if ( bSteam )
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) = params[2];
else
*( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_SCORE ) = params[2];
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) = params[2];
if ( params[3]){
//ScoreShort message
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
WRITE_BYTE(pPlayer->index);
WRITE_SHORT(params[2]);
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
if ( bSteam )
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
else
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_DEATHS ) );
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
WRITE_BYTE(1);
MESSAGE_END();
}
@ -274,14 +240,8 @@ static cell AMX_NATIVE_CALL is_weapon_deployed(AMX *amx, cell *params){
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if (pPlayer->ingame){
if ( bSteam ){
if ( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_WDEPLOY) == 1 )
return 1;
}
else {
if ( *( (int*)pPlayer->pEdict->pvPrivateData + WON_PDOFFSET_WDEPLOY) == 1 )
return 1;
}
if ( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_WDEPLOY) == 1 )
return 1;
}
return 0;
}
@ -295,7 +255,7 @@ static cell AMX_NATIVE_CALL set_user_ammo(AMX *amx, cell *params){
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if ( !pPlayer->ingame || !bSteam )
if ( !pPlayer->ingame )
return 0;
switch(params[2]){
@ -394,7 +354,6 @@ static cell AMX_NATIVE_CALL set_user_ammo(AMX *amx, cell *params){
return 1;
}
static cell AMX_NATIVE_CALL get_user_ammo(AMX *amx, cell *params){
int index = params[1];
if (index<1||index>gpGlobals->maxClients){
@ -403,7 +362,7 @@ static cell AMX_NATIVE_CALL get_user_ammo(AMX *amx, cell *params){
}
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
if ( !pPlayer->ingame || !bSteam )
if ( !pPlayer->ingame )
return 0;
switch(params[2]){