Your code won't work.
You're using get_players but you're completely ignoring the returned array players[].
So if you use get_players() and it will return an array like this:
players[] = { 1, 3, 6, 25 }
And then you loop players like this:
Code:
for(new id; id<inum;id++) {
server_print("%d", id)
}
You would get: 0, 1, 2, 3
This would most likely result in a crash because it would try to call functions with players 0 and 2 who don't exist. On top of that, players 6 and 25 would be left out of the loop completely.
But if you use it like this:
Code:
for(new id; id<inum;id++) {
server_print("%d", players[id])
}
You would get: 1, 3, 6, 25
Here's what it should look like:
Code:
#include <amxmodx>
#include <fun>
public plugin_init()
{
register_plugin("Drop weapons", "1.0", "FA");
register_logevent("round_end", 2, "1=Round_End");
}
public round_end()
{
new players[32],inum;
get_players(players,inum)
for(new id; id<inum;id++) {
if( is_user_alive(players[id]) )
{
strip_user_weapons(players[id]);
give_item(players[id], "weapon_knife");
}
}
}
__________________