Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #define ADMIN_FLAG ADMIN_SLAY
- native set_user_cash(id, amount)
- native get_user_cash(id)
- new Prefix[] = "^3[^1Prefix^3]^1"
- public plugin_init() register_clcmd("say /random", "cmdrandomwinner")
- public cmdrandomwinner(id)
- {
- if (!(get_user_flags(id) & ADMIN_FLAG))
- return client_print(id, print_chat, "%s You have no access to that command!", Prefix)
- new Amount = random_num(1, 30000)
- new winner = get_player()
- set_hudmessage(0, 212, 255, -1.0, 0.19, 0, 6.0, 12.0)
- show_hudmessage(0, "Random winner has started.^nThe winner is %s^nAnd he won %i", GetName(winner), Amount)
- set_user_cash(winner, get_user_cash(winner) + Amount)
- return 1;
- }
- stock get_player()
- {
- new players[ 32 ], num;
- get_players( players, num, "ch" );
- return players[ random( num ) ];
- }
- stock GetName( id )
- {
- static szName[ 32 ];
- get_user_name( id, szName, charsmax( szName ) );
- return szName;
- }
Add Comment
Please, Sign In to add comment