seroff

Auto Client CMD By Seroff

Jul 23rd, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. new Array:g_ArrayFile,szFile[]="addons/amxmodx/configs/autocmd.ini";
  4.  
  5. public plugin_init() {
  6. register_plugin("Auto Client CMD","1.0","Seroff");
  7. new sBuffer[512],sLine,sLen;
  8. sLine=0
  9. g_ArrayFile=ArrayCreate(512);
  10. if(!file_exists(szFile)) set_fail_state("File ^"autocmd.ini^" not found");
  11. while(read_file(szFile,sLine,sBuffer,64,sLen)!=0)
  12. {
  13. if(!sBuffer[0]||sBuffer[0]==';'||(sBuffer[0]=='/'&&sBuffer[1]=='/'))
  14. {
  15. sLine++;
  16. continue;
  17. }
  18. ArrayPushString(g_ArrayFile,sBuffer);
  19. sLine++;
  20. }
  21. if(!ArraySize(g_ArrayFile)) set_fail_state("Not info -> autocmd.ini");
  22. }
  23.  
  24. public client_connect(id){
  25. new sBuffer[512];
  26. for(new i=0;i<ArraySize(g_ArrayFile);i++){
  27. ArrayGetString(g_ArrayFile,i,sBuffer,sizeof(sBuffer)-1);
  28. console_cmd(id,sBuffer);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment