Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdkhooks>
  3. #include <colors>
  4.  
  5. #define MAX_PLAYERS 24 // maksymalna ilosc graczy na serwerze
  6. #define prefix "\x0C Ciekawy przedrostek \x01"
  7.  
  8. int ReklamaInfoo[MAX_PLAYERS+1];
  9.  
  10. public void OnClientPutInServer(int client)
  11. {
  12. ReklamaInfoo[client] = 0;
  13. CreateTimer(5.0, ReklamaInfo, client, TIMER_FLAG_NO_MAPCHANGE);
  14. }
  15.  
  16. public Action ReklamaInfo(Handle timer, int client)
  17. {
  18. if(!IsValidClient(client)) return;
  19.  
  20. switch(ReklamaInfoo[client])
  21. {
  22. case 0:
  23. {
  24. PrintToChat(client, "Wiadomość powitalna przy dołączeniu na serwer", prefix);
  25. }
  26. case 1: PrintToChat(client, "[%s] Właścicielem serwera jest: \x04xxxxxxxxxxxxxx", prefix);
  27. case 2: PrintToChat(client, "[%s] Dodaj nasz serwer do ulubionych IP: \x04xxxxxxxxx", prefix);
  28. case 3: PrintToChat(client, "[%s] Po grze zapraszamy na forum xxxxxxx", prefix);
  29. }
  30. ReklamaInfoo[client]++;
  31. if(ReklamaInfoo[client] > 3) ReklamaInfoo[client] = 1; //JEŻELI ZMIENIASZ ILOŚĆ REKLAM MUSISZ PODMIEC "3" NA ILOŚĆ REKLAM
  32.  
  33. CreateTimer(16.0, ReklamaInfo, client, TIMER_FLAG_NO_MAPCHANGE);
  34. }
  35. public bool IsValidClient(int client)
  36. {
  37. if(client >= 1 && client <= MaxClients && IsClientInGame(client))
  38. return true;
  39.  
  40. return false;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement