Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ShopAPI>
- public OnPluginStart()
- {
- RegConsoleCmd("RandomPoints", GivePointToRandomGuy);
- }
- public Action GivePointToRandomGuy(int client, int args)
- {
- int RandomGuy = GetRandomPlayer();
- int Amount = 99999;
- Native_GivePoints(RandomGuy, Amount);
- PrintToChatAll("%N has just got %d Points Randomly!", RandomGuy, Amount);
- return Plugin_Handled;
- }
- public int GetRandomPlayer()
- {
- new clients[MaxClients+1], clientCount;
- for (new i = 1; i <= MaxClients; i++)
- if (IsClientInGame(i))
- clients[clientCount++] = i;
- return (clientCount == 0) ? -1 : clients[GetRandomInt(0, clientCount-1)];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement