Guest User

Untitled

a guest
Oct 16th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. Hey guys, this is my first tutorial so please give me a REP +, I am a noob at scripting but in this tutorial I am going to teach you how to switch from strcmp to ZCMD.
  2.  
  3. Step 1: You need to go on top of your GM or FS and add this
  4. pawn Code:
  5.  
  6. #include zcmd
  7.  
  8. NOTE: You need to google up zcmd.inc and put it into your pawno/includes folder!
  9.  
  10. Step 2: You are going to need to get your STRCMP Command
  11. pawn Code:
  12.  
  13. if (strcmp("/drift5", cmdtext, true, 10) == 0)
  14. {
  15. SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
  16. SendClientMessage(playerid,-1,""COL_GREEN"[CONSOLE]: "COL_LIGHTBLUE"Welcome to Drift 5!");
  17. return 1;
  18. }
  19.  
  20.  
  21. Step 3: We are going to edit some things so the command looks like this
  22. pawn Code:
  23.  
  24. COMMAND:drift5(playerid, params)
  25. {
  26. SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
  27. SendClientMessage(playerid,-1,""COL_GREEN"[CONSOLE]: "COL_LIGHTBLUE"Welcome to Drift 5!");
  28. return 1;
  29. }
  30.  
  31. 1a. So in order for this to work you need to do STEP 1 obviously.
  32.  
  33. 2a. Go to OnPlayerCommandText
  34. and add this code right below it
  35. pawn Code:
  36.  
  37. {
  38. return 1;
  39. }
  40.  
  41.  
  42. 3a. You see this?
  43. pawn Code:
  44.  
  45. if (strcmp("/drift5", cmdtext, true, 10) == 0)
  46.  
  47.  
  48. You want to replace it with this
  49. pawn Code:
  50.  
  51. COMMAND:drift5(playerid, params[])
  52.  
  53.  
  54. After you did this, your ZCMD Command should look a little something like this
  55. This is what it should look like right after
  56. pawn Code:
  57.  
  58. public OnPlayerText(playerid, text[])
  59. {
  60. return 1;
  61. }
  62. COMMAND:drift5(playerid, params[])
  63. {
  64. SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
  65. SendClientMessage(playerid,-1,""COL_GREEN"[CONSOLE]: "COL_LIGHTBLUE"Welcome to Drift 5!");
  66. return 1;
  67. }
  68.  
  69.  
  70. CREDITS:
  71. Me - Making the Tutorial
  72. Others - Helping me correct some errors
  73.  
  74. NOTE: NO NEED TO ADD Return 0; at the end
  75.  
  76.  
  77. ANY ERRORS PLEASE JUST REPLY!!!
  78.  
  79. Please give me a REP! Thank you very much!
Add Comment
Please, Sign In to add comment