fork download
  1. stock bool:IsPlayerMuted(playerid) {
  2. return (((gettime() < PlayerInfo[playerid][pMuted]) ? (true) : (false)));
  3. }
  4. CMD:mute(playerid, params[])
  5. {
  6. if (!IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] < 1) {
  7. return SendClientMessage(playerid, COLOR_SERVER, "[BC:RP] {FFFFFF}Niste admin.");
  8. }
  9.  
  10. new
  11. targetID,
  12. muteTime,
  13. muteReason[50],
  14. playerName[MAX_PLAYER_NAME],
  15. targetName[MAX_PLAYER_NAME],
  16. buffer[144];
  17.  
  18. if (sscanf(params, "ris[32]", targetID, muteTime, muteReason)) {
  19. return SendClientMessage(playerid, COLOR_SERVER, "[Usage]: {FFFFFF}/mute [ID/Ime] [Vrijeme] [Razlog]") ;
  20. }
  21.  
  22. #if !defined MAX_MUTE_TIME //why tho
  23. #define MAX_MUTE_TIME 1000
  24. #endif
  25.  
  26. #if !defined IS_IN_RANGE
  27. #define IS_IN_RANGE(%0,%1,%2) (((%0)-((%1)+cellmin))<((%2)-((%1)+cellmin)))
  28. #endif
  29.  
  30. if (!(IS_IN_RANGE(muteTime, 0, MAX_MUTE_TIME + 1))) {
  31. return SendClientMessage(playerid, COLOR_SERVER, "[Usage]: Vrijeme ne moze biti manje od 0 (skidanje mute-a) i vece od "#MAX_MUTE_TIME".");
  32. }
  33.  
  34. if (!muteTime) {
  35. PlayerInfo[targetID][pMuted] = 0;
  36. PlayerInfo[targetID][pMutedReason][0] = '\0';
  37. SendClientMessage(playerid, -1, "Admin vam je skinuo mute.");
  38. return 1;
  39. }
  40.  
  41. GetPlayerName(playerid, playerName, sizeof(nameBuffer));
  42. format(buffer, sizeof(buffer), "Utisani ste od strane admina {FFFFFF}%s {FF0000} na {FFFFFF}%d {FF0000}minuta. Razlog: {FFFFFF}%s.", playerName, muteTime, muteReason);
  43. SendClientMessage(targetID, 0xFF0000FF, buffer);
  44.  
  45. GetPlayerName(targetID, targetName, sizeof(targetName));
  46. format(buffer, sizeof(buffer), "[Mute]: Admin {FFFFFF}%s {FF0000}je utisao igraca {FFFFFF}%s {FF0000}na {FFFFFF}%d {FF0000}minuta. Razlog: {FFFFFF}%s", playerName, targetName, muteTime, muteReason);
  47. foreach(Player, i) {
  48. if(PlayerInfo[i][pStaff]) {
  49. SendClientMessage(i, 0xFF0000FF, buffer);
  50. }
  51. }
  52.  
  53. #if !defined strcpy
  54. #define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1)
  55. #endif
  56.  
  57. // gettime() > returns UNIX time.
  58. // 60 * time > converts time to minutes
  59. PlayerInfo[targetID][pMuted] = gettime() + (60 * targetTime);
  60. strcpy(PlayerInfo[targetID][pMutedReason], muteReason);
  61.  
  62. return 1;
  63. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: error: unknown type name ‘stock’
 stock bool:IsPlayerMuted(playerid) {
 ^~~~~
prog.c:1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 stock bool:IsPlayerMuted(playerid) {
           ^
prog.c:4:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
 CMD:mute(playerid, params[])
    ^
prog.c:27:29: error: "%" may not appear in macro parameter list
         #define IS_IN_RANGE(%0,%1,%2) (((%0)-((%1)+cellmin))<((%2)-((%1)+cellmin)))
                             ^
prog.c:31:129: error: stray ‘#’ in program
         return SendClientMessage(playerid, COLOR_SERVER, "[Usage]: Vrijeme ne moze biti manje od 0 (skidanje mute-a) i vece od "#MAX_MUTE_TIME".");
                                                                                                                                 ^
prog.c:54:20: error: "%" may not appear in macro parameter list
     #define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1)
                    ^
stdout
Standard output is empty