Advertisement
Guest User

Whisper + Briefcase System - Kilos

a guest
Apr 19th, 2013
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. Briefcase System
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. if(strcmp(cmd, "/briefcase", true) == 0)
  10. {
  11. if(IsPlayerConnected(playerid))
  12. {
  13. if(PlayerInfo[playerid][pBCase] == 1)
  14. {
  15. if(BCase[playerid] == 0)
  16. {
  17. SetPlayerHoldingObject(playerid, 1210, 6,0.3,0.1,0,0,-90,0); // BriefCase
  18. SendClientMessage(playerid, COLOR_WHITE, " You have pulled out your briefcase. ");
  19. BCase[playerid] = 1;
  20. return 1;
  21. }
  22. else if(BCase[playerid] == 1)
  23. {
  24. StopPlayerHoldingObject(playerid);
  25. SendClientMessage(playerid, COLOR_WHITE, " You have put away your briefcase. ");
  26. BCase[playerid] = 0;
  27. return 1;
  28. }
  29. }
  30. else
  31. {
  32. SendClientMessage(playerid, COLOR_GRAD2, " You don't own a briefcase !");
  33. return 1;
  34. }
  35. return 1;
  36. }
  37. return 1;
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Small Whisper System
  61.  
  62.  
  63. if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
  64. {
  65. if(IsPlayerConnected(playerid))
  66. {
  67. if(gPlayerLogged[playerid] == 0)
  68. {
  69. SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
  70. return 1;
  71. }
  72. new str[160];
  73. GetPlayerName(playerid, str, MAX_PLAYER_NAME);
  74. for (new i = 0; i < MAX_PLAYER_NAME; i++)
  75. if (str[i] == '_')
  76. str[i] = ' ';
  77. new length = strlen(cmdtext);
  78. while ((idx < length) && (cmdtext[idx] <= ' '))
  79. {
  80. idx++;
  81. }
  82. new offset = idx;
  83. new result[64];
  84. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  85. {
  86. result[idx - offset] = cmdtext[idx];
  87. idx++;
  88. }
  89. result[idx - offset] = EOS;
  90. if(!strlen(result))
  91. {
  92. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /(w)isper [whispering text]");
  93. return 1;
  94. }
  95. format(str, sizeof(str), "%s whispers: %s", str, result);
  96. ProxDetector(2.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  97. printf("%s", str);
  98. }
  99. return 1;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement