Advertisement
Guest User

[RP] Chat Commands v4.4

a guest
Aug 17th, 2010
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.18 KB | None | 0 0
  1.  
  2.  
  3. #include <a_samp>
  4. #include "../include/chat.inc"
  5.  
  6. #define MESSAGE_COLOR         0xEEEEEEFF
  7. #define ECHO_COLOR            0xEEEEEEFF
  8. #define ACTION_COLOR          0x00CC00
  9.  
  10. //------------------------------------------------
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     print("\n--New Chat Commands by scratch -By JonnyBoy-.\n");
  15.     print("\n--Version 4.4-.\n");
  16.     return 1;
  17. }
  18.  
  19. //------------------------------------------------
  20. // Feel Free to use this but don't Remove (Made vy: JonnyBoy!)
  21. //------------------------------------------------
  22. // If you use this on your server please make a credit for me :)
  23. //*******-- THINGS YOU CAN AND CAN'T DO! --*******
  24. // You can't claim this as your own!
  25. // You can't Sell this or make money from it!
  26. // You can ONLY use it on the server!
  27. //------------------------------------------------
  28.  
  29. public OnPlayerCommandText(playerid, cmdtext[])
  30. {
  31.     new cmd[256];
  32.     new Message[256];
  33.     new idx;
  34.     new actiontext[MAX_CHATBUBBLE_LENGTH+1];
  35.  
  36.     cmd = strtok(cmdtext, idx);
  37.  
  38.     // Action command
  39.     if(strcmp("/me", cmd, true) == 0)
  40.     {
  41.         Message = strrest(cmdtext,idx);
  42.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"* %s",Message);
  43.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,20.0,10000);
  44.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  45.         return 1;
  46.     }
  47.     if(strcmp("/sa", cmd, true) == 0)
  48.     {
  49.         Message = strrest(cmdtext,idx);
  50.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Server Admin] %s",Message);
  51.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,10.0,10000);
  52.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  53.         return 1;
  54.     }
  55.     if(strcmp("/ad", cmd, true) == 0)
  56.     {
  57.         Message = strrest(cmdtext,idx);
  58.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Admin] %s",Message);
  59.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,5.0,10000);
  60.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  61.         return 1;
  62.     }
  63.     if(strcmp("/n", cmd, true) == 0)
  64.     {
  65.         Message = strrest(cmdtext,idx);
  66.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Newbie] %s",Message);
  67.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,3.0,10000);
  68.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  69.         return 1;
  70.     }
  71.     if(strcmp("/h", cmd, true) == 0)
  72.     {
  73.         Message = strrest(cmdtext,idx);
  74.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Helper] %s",Message);
  75.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,3.0,10000);
  76.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  77.         return 1;
  78.     }
  79.     if(strcmp("/race", cmd, true) == 0)
  80.     {
  81.         Message = strrest(cmdtext,idx);
  82.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Race] Race at %s and win 2000$! /ra for [Race] Chat!",Message);
  83.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,2.0,10000);
  84.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  85.         return 1;
  86.     }
  87.     if(strcmp("/ra", cmd, true) == 0)
  88.     {
  89.         Message = strrest(cmdtext,idx);
  90.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Race] %s",Message);
  91.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,2.0,10000);
  92.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  93.         return 1;
  94.     }
  95.     if(strcmp("/s", cmd, true) == 0)
  96.     {
  97.         Message = strrest(cmdtext,idx);
  98.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[STOP] %s",Message);
  99.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,4.0,10000);
  100.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  101.         return 1;
  102.     }
  103.     if(strcmp("/rc", cmd, true) == 0)
  104.     {
  105.         Message = strrest(cmdtext,idx);
  106.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[RP]Chat Commands Made by JonnyBoy",Message);
  107.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,4.0,10000);
  108.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  109.         return 1;
  110.     }
  111.     if(strcmp("/rp_cmd", cmd, true) == 0)
  112.     {
  113.         Message = strrest(cmdtext,idx);
  114.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[HELP] To see all Commands look at Roleplay/Chat/index.html",Message);
  115.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,4.0,10000);
  116.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  117.         return 1;
  118.     }
  119.  
  120. //------------------------------------------------
  121. //                NEW COMMANDS!!                 -
  122. //------------------------------------------------
  123.     if(strcmp("/warn", cmd, true) == 0)
  124.     {
  125.         Message = strrest(cmdtext,idx);
  126.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Warn] %s",Message);
  127.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,10.0,10000);
  128.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  129.         return 1;
  130.     }
  131.     if(strcmp("/tip", cmd, true) == 0)
  132.     {
  133.         Message = strrest(cmdtext,idx);
  134.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[TIP] %s",Message);
  135.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,10.0,10000);
  136.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  137.         return 1;
  138.     }
  139.     if(strcmp("/rek", cmd, true) == 0)
  140.     {
  141.         Message = strrest(cmdtext,idx);
  142.         format(actiontext,MAX_CHATBUBBLE_LENGTH,"[Recruiting] We are now recruting members at %s",Message);
  143.         SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,10.0,10000);
  144.         SendClientMessage(playerid,ACTION_COLOR,actiontext);
  145.         return 1;
  146.     }
  147.     return 0; // not handled by this script
  148. }
  149.  
  150. //------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement