mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Added request am40169
This commit is contained in:
parent
c80b7fd422
commit
afe7df87d2
@ -522,11 +522,18 @@ static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amx, cell *params) // cs_get_u
|
||||
// params[1] = user index
|
||||
|
||||
// Valid entity should be within range
|
||||
cell *model;
|
||||
CHECK_PLAYER(params[1]);
|
||||
|
||||
// Make into edict pointer
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -119,19 +119,6 @@ native cs_get_user_plant(index);
|
||||
*/
|
||||
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.
|
||||
* 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);
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
native cs_get_user_vip(index);
|
||||
|
Loading…
Reference in New Issue
Block a user