|
|
#1 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2010
Location: United Kingdom
Posts: 427
Reputation: 25
|
Creating teleports is easy, if you don't know I will show you.
In this tutorial I will create a teleport command to bayside. First of all go into your filterscript/gamemode and go to. pawn Code:
You can press Ctrl + F to search to find this if it is easier. Now create a new line after the { under OnPlayerCommandText. Now we are going to add what we will type in, for it to recongnize the teleport. So add this. I will leave /bayside in because I am making mine teleport to Bayside, if you want to go some were else just change the /bayside pawn Code:
Now create a new line. Under that your next line will be the players position, the place were the player will be teleported to. You can get your co-ordinates for the places by going to a server or your home server or in debug mode and press /save at the place you want. To save your exact co-ordinates. So lets get back to the tutorial. We have this. pawn Code:
The next line will be this. pawn Code:
I am doing bayside. The co-ordinates are sperated into 3 categories. Float X Float Y Float Z My Co-ordinates are these. Float X: -2271.0764, Float Y: 2317.8457, Float Z: 4.8202 Lets add them to the pawn Code:
SetPlayerPos(playerid, Float , Float:y, Float:z);Change the Float X,Y and Z to your co-ordinates. SetPlayerPos(playerid, -2271.0764, 2317.8457, 4.8202); So now our command looks like this. pawn Code:
Now we are going to add the players facing angle, the angle the player will be facing when he teleports to the location. To do this we add a line under SetPlayerPos and put this. pawn Code:
I will choose 180 degrees, so simply just type your angle after the playerid, It will look like this. Don't forget the closed bracket and semi colon after your angle pawn Code:
So far this is how the command should look. pawn Code:
Now we are going to add the client message, which will be sent to the player when he teleports there. Once again, create a new line under the last one we did. Now to start the client message put this under SetPlayerFacingAngle. pawn Code:
To put your message in, type your message in between the quotation marks. So this is mine. pawn Code:
pawn Code:
We now finish off the command by adding. Under the command. pawn Code:
Finally it should look like this. pawn Code:
//-------------------------EXTRAS-----------------------------EXTRAS----------------------------------------- //-------------------------EXTRAS-----------------------------EXTRAS----------------------------------------- I will show you some extras that you can do to your teleport command. First of, give the player a weapon. Anywere in your command, above the return 1 and below the if(strcmp("/bayside", cmdtext, true) == 0) Add this line. pawn Code:
We will first get the weapon ID by going to this webpage http://wiki.sa-mp.com/wiki/Weapons I will choose a sniper. So my ID I need to get is ID 34. Now back to the code, add your weapon ID after the first comma in the command (add a space aswell) So it will look like this. pawn Code:
It will look like this. pawn Code:
pawn Code:
Now you may want to reset all the players weapons on teleport. So just simply add this to a line in your teleport command. pawn Code:
pawn Code:
So, so far in my commands, the player gets teleported to Bayside, his facing angle is 180 degrees, he gets a client message, his weapons get reset and he gets given a sniper with 100 ammo. I will end this tutorial with adding the player to a virtual world. Again, add this code into your command so far. pawn Code:
Now after the comma and space add a virtual world, the default for everyone is 0, so make it something other than 0. I will use 5 for my example. Should then look like this. pawn Code:
Now the whole command will look like this. pawn Code:
One last extra for today. You want two commands to go to the same place like /bayside and /bs Just do this. This is our first line pawn Code:
Then we copy this next to the first line pawn Code:
It should look like this. pawn Code:
Now for the whole command should look like this. pawn Code:
Edit: A tutorial I made to teleport your player to a location and get a vehicle http://forum.sa-mp.com/showthread.php?t=230467 Thank you, I hope I have helped. I know people will say "or this is easy" but for new people, it isn't, so anyone out there who doesn't know what to do. I hope I have helped. Last edited by captainjohn; 23/02/2011 at 04:58 PM. |
|
|
|
|
|
#2 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Apr 2010
Location: Brazil
Posts: 848
Reputation: 5
|
Nice Tutorial...helped many beginners
|
|
|
|
|
|
#3 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2010
Posts: 1,452
Reputation: 68
|
tutorial very well done ..
congratulations |
|
|
|
|
|
#4 |
|
Huge Clucker
![]() ![]() ![]() Join Date: Dec 2009
Location: India
Posts: 377
Reputation: 1
|
But strcmps have gone off use. Most people switch to zcmd or ycmd or dcmd. So you can add them too.
|
|
|
|
|
|
#5 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Feb 2010
Posts: 1,306
Reputation: 86
|
LOL Why would you reset a players weapon then give one, the one you give probably gets reset to...
|
|
|
|
|
|
#6 | |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2010
Location: United Kingdom
Posts: 427
Reputation: 25
|
Quote:
Like a person could have sawns,macs,ak47 and they might want to go to a snipe deathmatch. So you could reset all players weapons and give them a sniper... So think before you post. |
|
|
|
|
|
|
#7 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Jul 2010
Location: Central Europe
Posts: 546
Reputation: 21
|
why teleport making is so complicated?, by the way it's a nice tutorial
|
|
|
|
|
|
#8 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,086
Reputation: 111
|
Adding teleporting players in their vehicles to the tut, will round it off nicley.
Peace... |
|
|
|
|
|
#9 | |
|
Huge Clucker
![]() ![]() ![]() Join Date: Jul 2010
Location: United Kingdom
Posts: 427
Reputation: 25
|
Quote:
http://forum.sa-mp.com/showthread.php?t=230467 Anybody want me to add anything else? Just ask. |
|
|
|
|
|
|
#10 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,086
Reputation: 111
|
[QUOTE=captainjohn;1086084]Already done something similar.
http://forum.sa-mp.com/showthread.php?t=230467 Yeah i see, that bit of info would better in this tutorial, along with teleporting payers in vehicles. Then you will have a good around teleporting tutorial for beginners. A one stop shop. ![]() Peace... |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help With This Teleport Command! | Elmerz_com | Help Archive | 14 | 18/01/2011 07:24 PM |
| A teleport command! | davaj | Help Archive | 5 | 20/08/2009 12:48 PM |