mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-01-12 23:08:03 +03:00
Added param availability check + 2 more params in the forward
This commit is contained in:
parent
b4170b451c
commit
a3f5769058
@ -2861,12 +2861,14 @@ static cell AMX_NATIVE_CALL set_user_flags(AMX *amx, cell *params) /* 4 param */
|
||||
if (id > 31)
|
||||
id = 31;
|
||||
|
||||
if(params[4])
|
||||
int oldflags = pPlayer->flags[id];
|
||||
|
||||
if((*params / sizeof(cell) >= 4) && params[4])
|
||||
pPlayer->flags[id] = flag;
|
||||
else
|
||||
pPlayer->flags[id] |= flag;
|
||||
|
||||
executeForwards(FF_ClientFlagsUpdated, static_cast<cell>(pPlayer->index), pPlayer->flags[id]);
|
||||
executeForwards(FF_ClientFlagsUpdated, static_cast<cell>(pPlayer->index), oldflags, pPlayer->flags[id], id);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -2890,9 +2892,11 @@ static cell AMX_NATIVE_CALL remove_user_flags(AMX *amx, cell *params) /* 3 param
|
||||
|
||||
if (id > 31)
|
||||
id = 31;
|
||||
|
||||
int oldflags = pPlayer->flags[id];
|
||||
|
||||
pPlayer->flags[id] &= ~flag;
|
||||
executeForwards(FF_ClientFlagsUpdated, static_cast<cell>(pPlayer->index), pPlayer->flags[id]);
|
||||
executeForwards(FF_ClientFlagsUpdated, static_cast<cell>(pPlayer->index), oldflags, pPlayer->flags[id], id);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ int C_Spawn(edict_t *pent)
|
||||
FF_ClientAuthorized = registerForward("client_authorized", ET_IGNORE, FP_CELL, FP_STRING, FP_DONE);
|
||||
FF_ChangeLevel = registerForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE);
|
||||
FF_ClientConnectEx = registerForward("client_connectex", ET_STOP, FP_CELL, FP_STRING, FP_STRING, FP_ARRAY, FP_DONE);
|
||||
FF_ClientFlagsUpdated = registerForward("client_flags_updated", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE);
|
||||
FF_ClientFlagsUpdated = registerForward("client_flags_updated", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
||||
|
||||
CoreCfg.OnAmxxInitialized();
|
||||
|
||||
|
@ -163,11 +163,13 @@ forward client_connectex(id, const name[], const ip[], reason[128]);
|
||||
* Called after the client's admin flags are changed.
|
||||
*
|
||||
* @param id Client index
|
||||
* @param flags New client flags
|
||||
* @param oldflags Old client flags
|
||||
* @param newflags New client flags
|
||||
* @param set Flag set id
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
forward client_flags_updated(id, flags);
|
||||
forward client_flags_updated(id, oldflags, newflags, set);
|
||||
|
||||
/**
|
||||
* Called when the client gets a valid SteamID.
|
||||
|
Loading…
x
Reference in New Issue
Block a user