Raised This Month: $ Target: $400
 0% 

plugin amxmodx shutdown pc scripting


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pyl199
New Member
Join Date: Sep 2011
Old 09-23-2011 , 12:37   plugin amxmodx shutdown pc scripting
Reply With Quote #1

hi
I try make a script to shut down the computer: (plugin cs 1.5 amxmodx)

this is it...



#include <amxmodx>
#include <amxmisc>

public plugin_init() {
register_plugin("pc Shutdown", "0.1", "kdog")
register_concmd("amx_shutdownpc","pcshutdown" ,ADMIN_IMMUNITY," - Shuts down pc in 10 seconds")
}


public pcshutdown(id) {
if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {
console_print(id,"[AMXX] You can't use this command.")
return PLUGIN_HANDLED
}
set_task(0.0,"alert")
set_task(3.0,"ten")
set_task(4.0,"nine")
set_task(5.0,"eight")
set_task(6.0,"seven")
set_task(7.0,"six")
set_task(8.0,"five")
set_task(9.0,"four")
set_task(10.0,"three")
set_task(11.0,"two")
set_task(12.0,"one")
set_task(13.0,"zero")
set_task(17.0,"off_pc")

return PLUGIN_HANDLED
}

public alert() {
client_print(0,print_chat,"***** The pc will shutdown! *****")
server_print("***** ALERT! PC Shutdown! *****")
client_cmd(0,"spk ^"fvox/warning.wav^"")
}

public ten() {
client_print(0,print_chat,"Pc will shutdown in 10 seconds. Good bye & return!")
server_print("Pc Shutdown in 10....")
client_cmd(0,"spk ^"fvox/ten.wav^"")
}

public nine() {
client_print(0,print_chat,"Pc ShutDown in 9")
server_print("Pc Shutdown in 9....")
client_cmd(0,"spk ^"fvox/nine.wav^"")
}

public eight() {
client_print(0,print_chat,"Pc ShutDown in 8")
server_print("Pc Shutdown in 8....")

client_cmd(0,"spk ^"fvox/eight.wav^"")
}

public seven() {
client_print(0,print_chat,"Pc ShutDown in 7")
server_print("Pc Shutdown in 7....")

client_cmd(0,"spk ^"fvox/seven.wav^"")
}

public six() {
client_print(0,print_chat,"Pc ShutDown in 6")
server_print("Pc Shutdown in 6....")

client_cmd(0,"spk ^"fvox/six.wav^"")
}

public five() {
client_print(0,print_chat,"Pc ShutDown in 5")
server_print("Pc Shutdown in 5....")

client_cmd(0,"spk ^"fvox/five.wav^"")
}

public four() {
client_print(0,print_chat,"Pc ShutDown in 4")
server_print("Pc Shutdown in 4....")

client_cmd(0,"spk ^"fvox/four.wav^"")
}

public three() {
client_print(0,print_chat,"Pc ShutDown in 3")
server_print("Pc Shutdown in 3....")

client_cmd(0,"spk ^"fvox/three.wav^"")
}

public two() {
client_print(0,print_chat,"Pc ShutDown in 2")
server_print("Pc Shutdown in 2....")

client_cmd(0,"spk ^"fvox/two.wav^"")
}

public one() {
client_print(0,print_chat,"Pc ShutDown in 1")
server_print("Pc Shutdown in 1....")

client_cmd(0,"spk ^"fvox/one.wav^"")
}

public zero() {
client_print(0,print_chat,"Pc Shutdown NOW !")
server_print("Pc Shutdown NOW ! Please Come back!")

client_cmd(0,"spk ^"fvox/safe_day.wav^"")
}


int main () {

system("shut down -s -t 10");

return 0;


}





but it doesn't work. i want to help me..tnx
pyl199 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode