Added request am40169

This commit is contained in:
Borja Ferrer 2006-08-20 00:20:47 +00:00
parent c80b7fd422
commit afe7df87d2
2 changed files with 20 additions and 13 deletions

View File

@ -522,11 +522,18 @@ static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amx, cell *params) // cs_get_u
// params[1] = user index // params[1] = user index
// Valid entity should be within range // Valid entity should be within range
cell *model;
CHECK_PLAYER(params[1]); CHECK_PLAYER(params[1]);
// Make into edict pointer // Make into edict pointer
edict_t *pPlayer = MF_GetPlayerEdict(params[1]); edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
if ((params[0] / sizeof(cell)) >= 2)
{
model = MF_GetAmxAddr(amx, params[2]);
*model = *((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL);
}
return *((int *)pPlayer->pvPrivateData + OFFSET_TEAM); return *((int *)pPlayer->pvPrivateData + OFFSET_TEAM);
} }

View File

@ -119,19 +119,6 @@ native cs_get_user_plant(index);
*/ */
native cs_set_user_plant(index, plant = 1, showbombicon = 1); native cs_set_user_plant(index, plant = 1, showbombicon = 1);
/* Get team directly from player's entity.
* 1 = terrorist
* 2 = counter-terrorist
* 3 = spectator
*/
enum CsTeams {
CS_TEAM_UNASSIGNED = 0,
CS_TEAM_T = 1,
CS_TEAM_CT = 2,
CS_TEAM_SPECTATOR = 3
};
native CsTeams:cs_get_user_team(index);
/* Set user team without killing player. /* Set user team without killing player.
* If model is anything other than CS_DONTCHANGE, that will be set as player's model. * If model is anything other than CS_DONTCHANGE, that will be set as player's model.
*/ */
@ -151,6 +138,19 @@ enum CsInternalModel {
}; };
native cs_set_user_team(index, {CsTeams,_}:team, {CsInternalModel,_}:model = CS_DONTCHANGE); native cs_set_user_team(index, {CsTeams,_}:team, {CsInternalModel,_}:model = CS_DONTCHANGE);
/* Get team directly from player's entity.
* 1 = terrorist
* 2 = counter-terrorist
* 3 = spectator
*/
enum CsTeams {
CS_TEAM_UNASSIGNED = 0,
CS_TEAM_T = 1,
CS_TEAM_CT = 2,
CS_TEAM_SPECTATOR = 3
};
native CsTeams:cs_get_user_team(index, &{CsInternalModel,_}:model = CS_DONTCHANGE);
/* Is user vip? Returns 1 if true, 0 if false. /* Is user vip? Returns 1 if true, 0 if false.
*/ */
native cs_get_user_vip(index); native cs_get_user_vip(index);