Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sdktools>
- #include <store> // NVM THIS <
- #include <zephstocks> // and this <
- #include <sourcemod>
- new Handle:countdownTimer = INVALID_HANDLE;
- new g_cvarMin = -1;
- new g_cvarMax = -1;
- public Plugin:myinfo =
- {
- name = "Raffle re-make",
- author = "Grandpa",
- description = "Gives credits to random client.",
- version = "1.0",
- url = "redtube.com"
- }
- public OnPluginStart()
- {
- RegAdminCmd("sm_test", Command_Countdown, ADMFLAG_CHAT, "Generates a random number for a raffle.");
- g_cvarMin = RegisterConVar("sm_store_raffle_min_credits", "200", "Minimum amount of credits", TYPE_INT);
- g_cvarMax = RegisterConVar("sm_store_raffle_max_credits", "1000", "Maximum amount of credits", TYPE_INT);
- }
- public Action:Command_Countdown(iClient, args)
- {
- countdownTimer = CreateTimer(1.0, Timer_Countdown, INVALID_HANDLE, TIMER_REPEAT);
- countdownTimer = 10;
- return Plugin_Handled;
- }
- public Action:Timer_Countdown(Handle:timer)
- {
- new credits = GetRandomInt(g_eCvars[g_cvarMin][aCache], g_eCvars[g_cvarMax][aCache]);
- if(countdownTimer <= 0) {
- KillTimer(countdownTimer);
- PrintToChatAll("goes here");
- return Plugin_Handled;
- } else {
- PrintCenterTextAll("A Raffle for %d credits, is starting in: %i seconds.", credits, countdownTimer);
- countdownTimer--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement