wont work, ts_givepwup doesn't work. You have to createpwup then set its origin UNDER the person then they move into it. that function has never worked sadily,
Code:
static cell AMX_NATIVE_CALL give_pwup(AMX *amx, cell *params)
{ // index,pwupentindex
edict_t* pent = INDEXENT(params[2]);
if ( FNullEnt( pent ) || strcmp("ts_powerup",STRING(pent->v.classname))!=0 ){
return 0;
}
int id = params[1];
if (id<1 || id>gpGlobals->maxClients)
{
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", id);
return 0;
}
CPlayer *pPlayer = GET_PLAYER_POINTER_I(id);
if (!pPlayer->ingame || !pPlayer->IsAlive())
{
MF_LogError(amx, AMX_ERR_NATIVE, "Player %d is not ingame.", id);
return 0;
}
pent->v.origin = pPlayer->pEdict->v.origin;
MDLL_Touch(pent, pPlayer->pEdict);
REMOVE_ENTITY(pent);
return 1;
}