Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- Step 1: You need to go on top of your GM or FS and add this
- pawn Code:
- #include zcmd
- NOTE: You need to google up zcmd.inc and put it into your pawno/includes folder!
- Step 2: You are going to need to get your STRCMP Command
- pawn Code:
- if (strcmp("/drift5", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
- SendClientMessage(playerid,-1,""COL_GREEN"[CONSOLE]: "COL_LIGHTBLUE"Welcome to Drift 5!");
- return 1;
- }
- Step 3: We are going to edit some things so the command looks like this
- pawn Code:
- COMMAND:drift5(playerid, params)
- {
- SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
- SendClientMessage(playerid,-1,""COL_GREEN"[CONSOLE]: "COL_LIGHTBLUE"Welcome to Drift 5!");
- return 1;
- }
- 1a. So in order for this to work you need to do STEP 1 obviously.
- 2a. Go to OnPlayerCommandText
- and add this code right below it
- pawn Code:
- {
- return 1;
- }
- 3a. You see this?
- pawn Code:
- if (strcmp("/drift5", cmdtext, true, 10) == 0)
- You want to replace it with this
- pawn Code:
- COMMAND:drift5(playerid, params[])
- After you did this, your ZCMD Command should look a little something like this
- This is what it should look like right after
- pawn Code:
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- COMMAND:drift5(playerid, params[])
- {
- SetPlayerPos(playerid, 1146.2200,2178.7068,10.8203);
- SendClientMessage(playerid,-1,""COL_GREEN"[CONSOLE]: "COL_LIGHTBLUE"Welcome to Drift 5!");
- return 1;
- }
- CREDITS:
- Me - Making the Tutorial
- Others - Helping me correct some errors
- NOTE: NO NEED TO ADD Return 0; at the end
- ANY ERRORS PLEASE JUST REPLY!!!
- Please give me a REP! Thank you very much!
Add Comment
Please, Sign In to add comment