[Include] [INC] Advanced Teleports! V. 1.0
#1

[size=21px]Advanced Teleports - Include by [MFC]Sylar - Version 1.00![/size]
Hi! this is my first Include.

It's about advanced Teleports. Why am I relasing this? because this forum helped me a lot, when i needed help I almost always got it. And also downloaded scripts, maps, etc. Thank you a lot!

_________________________________________________
Theese are the functions:
pawn Code:
native SetOnFootPos(playerid, Float:x, Float:y, Float:z, Float:a, interior);
native SetCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior);
native SetXCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, VehicleModel);
native SetSkinPlayerCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, PSkin);
native SetOnFootSkinPos(playerid, Float:x, Float:y, Float:z, Float:a, interior, PSkin);
native SetCarIdPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, interior, Vid);
native SetHealthPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, Float:Health);
native SetArmourPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, Float:Armour);
native SetMoneyPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, money);
// native SetTeamPlayerPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, const Team[]); // Not working ATM
native SetScorePos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, playerscore);
_________________________________________________

Changelog;
Quote:

Ver. 0.1 ---> Ver. 1.00

Added: SetCarIdPos
Added: SetHealthPos
Added: SetArmourPos
Added: SetMoneyPos
Added: SetTeamPlayerPos
Added: SetScorePos
Deleted: SetNrgPos
_________________________________________________
*Please Note the following: All funcions come with the TogglePlayerControllable if you are using a Menu.
_________________________________________________
pawn Code:
SetOnFootPos(playerid, Float:x, Float:y, Float:z, Float:a, interior);
This function is like SetPlayerPos, but with an Interior function, and the Player Angle (Pa). An Example:

pawn Code:
SetOnFootPos(playerid, 2014.254, 1024.2521, 321.45255, 210.0, 0);
_________________________________________________

pawn Code:
SetCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior);
This is a basic function, V = Vehicle, P = Player. You set all three coords, the angle for each State. And obviously the Interior. If you are in a Vehicle you'll be teleported to de Vehicle Location, else you'll be teleported to the Player Location.

pawn Code:
SetCarPos(playerid, 531.0353, 3421.0355, 321.3503, 214.0, 2014.254, 1024.2521, 321.45255, 0)
_________________________________________________

pawn Code:
SetXCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, Vmodel);
The same as the SetCarPos. But it will only teleport you to the Vehicle Location if you are on a Specific Vehicle Model (Vmodel). Else you'll be teleported on foot to the Player normal Location.

pawn Code:
SetXCarPos(playerid, 531.0353, 3421.0355, 321.3503, 214.0, 2014.254, 1024.2521, 321.45255, 0, 288)
_________________________________________________

pawn Code:
SetSkinPlayerCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, PSkin);
This function would be the same as the "SetCarPos" or "SetXCarPos" The difference here would be, you need a Specific Skin for the teleport, if you don't have that skin you will not be teleported to ANY of that locations! You will also recive an error Message if you haven't that Skin. No Examples Needed.

_________________________________________________

pawn Code:
SetOnFootSkinPos(playerid, Float:x, Float:y, Float:z, Float:a, interior, PSkin);
The same as Above, but only the Player will get teleported, not the car . You will also recive an error Message if you haven't that Skin. No Examples Needed.

_________________________________________________

pawn Code:
SetCarIdPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, interior, Vid);
This is like "SetXCarPos" but the difference is that if you aren't in the specified auto you'll get an Error message (telling you in wich vehicle you need to be) and you Wont teleport.

_________________________________________________

pawn Code:
SetHealthPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, Float:Health);
Here you need to have certain Health to teleport. Here i changed the whole include a bit, now you have a "Toggle" that will (or not) teleport the car. If it is true, and you have enough Health you will teleport with a Car (if you are in one), else you wont, or if it's toggled false your vehicle wont teleport.

pawn Code:
SetHealthPos(playerid, 325.3212, 321.242, 102.254, 90.0, 0, true, 100.0);
_________________________________________________

pawn Code:
SetArmourPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, Float:Armour);
Same as above, but using Armour.

_________________________________________________

pawn Code:
SetMoneyPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, money);
Here you need to pay money for teleporting. If you don't have money you'll recive an error message telling you how much you need, else you will teleport and you will loose your money.

_________________________________________________

pawn Code:
SetTeamPlayerPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, const Team[]);
Not working ATM! -> Normal teleport, but you need to be in a certain Team to teleport.

_________________________________________________

pawn Code:
SetScorePos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, playerscore);
You need to have certain Score to teleport! Note: You won't loose your score!

_________________________________________________
_________________________________________________

[size=18px]Getting Started!:[/size]
First of All, download this:

In your script:
_________________________________________________

At the first of your Script/GM you need to have this (Under "#include <a_samp>")

pawn Code:
#include <MFC-Teleports> // Advanced Teleports by [MFC]Sylar
_________________________________________________

Two examples to know how to use this Cmd's: (in different contexts)
In a Menu:
pawn Code:
case 0: //================ Area 51 - Army Skin Only!
    {
    SetSkinPlayerCarPos(playerid, 308.2827,1989.2064,17.6406, 0.0, 308.2827,1989.2064,17.6406, 0.0, 0, 287);
    }
_________________________________________________

With a command:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Area51", cmdtext, true) == 0)
    {
    SetSkinPlayerCarPos(playerid, 308.2827,1989.2064,17.6406, 0.0, 308.2827,1989.2064,17.6406, 0.0, 0, 287);
    }
return 0;
}
_________________________________________________
_________________________________________________

[size=16px]Also you can add in your script:[/size]
At the top:
pawn Code:
#define A SetOnFootPos
#define B SetCarPos

// etc. You can add shortly abreviations for the functions if you want.
Note: Don't use as define things like "A". You will obvioulsy get +26 errors. Set it like SetPP, or whatever, or use it as it is

Example:
pawn Code:
#include <TeleInclude_By_[MFC]Sylar> // Advanced Teleports by [MFC]Sylar
#define SOFP SetOnFootPos

public OnPlayerSpawn(playerid)
{
SOFP(playerid, 10.0, 10.0, 10.0, 10.0, 0);
}
TESTED!

_________________________________________________
_________________________________________________

[size=18px]In the future Versions:[/size]
pawn Code:
SetAdminPos ( For RCON admin teleports)
SetCheckpointPos ( You will need to be in X checkpoint to teleport)
SetIsInAreaPos ( Same as above, but not a checkpoint, an area)
SetDeathmatchPos(playerid, x, y, z, a, wep_1, bullets, wep_2, bullets, wep_3, bullets, wep_4, bullets, interior); //A Teleport that gives you up to 4 (or more) weapons. Used For deathmatch
_________________________________________________
_________________________________________________

[size=16px]Notes:[/size]
1) Sorry for my bad English
2) Any suggestion for Functions will be really apreciated!
3) If you find any bugs please tell me
4) You don't have to give me credits; but don't relase it, or resell it, without my permission.
5) I added my ideas above, so add yours too
6) Click Here if you wanna know the ID's of anything you want (interiors, cars, skins, etc.)

_________________________________________________
_________________________________________________

Hope you all like it, is my first include

Special Thanks to: Weirdospot (Helped with the CarId func.)

See ya!!!!

_________________________________________________

[MFC]Sylar

Reply
#2

pretty OK, well done
Reply
#3

Quote:

SetNrgPos(playerid, 531.0353, 3421.0355, 321.3503, 214.0, 0)

Why not make the command like SetXCarPos but only for vehicles.. seems a bit limiting having it only for NRG's..

Other than that it's pretty simple but time saving, well done.
Reply
#4

Pretty good script for saving some time and the size of the scripts.(Also the no. of lines in the scripts)
Also,you may add definition of the simpler symbols ([A],[B],etc.)in your include.Users can save time to add the definitions.
Reply
#5

Quote:
Originally Posted by Weirdosport
Quote:

SetNrgPos(playerid, 531.0353, 3421.0355, 321.3503, 214.0, 0)

Why not make the command like SetXCarPos but only for vehicles.. seems a bit limiting having it only for NRG's..

Other than that it's pretty simple but time saving, well done.
Well. I said that before. The NRG Set Pos will take your NRG to a specified place. But if you aren't in the NRG it WONT take you there and it would send you a message telling that the map is only for NRG's.

The SetXCarPos will take you to the place if you AREN'T in X Vehicle. Obviously On Foot. The NRG command don't.. but, why NRG? because for StuntServers it's the most common vehicle. Supposing you want also one for a Bike and one for an Infernus, you can just tell me, or make it yourself (pretty easy seeing the include, not an advanced one, just lots of simple functions all in one..)

I can also make a command like "SetXCarPos" without the Player coords, but i forgot how to do the error message telling you wich vehicle do you need. (I could make that with ID's but it would be the same as don't telling you anything)

I hope i made it clear what I ment to say.
Reply
#6

What's advanced about it?
Reply
#7

very nice
Reply
#8

pawn Code:
new VehicleNames[212][] = {
    "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
    "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
    "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
    "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
    "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
    "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
    "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
    "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
    "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
    "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
    "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
    "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
    "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
    "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
    "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
    "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
    "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
Using that array and a little bit of format you can make error messages that tell the player they must use whatever vehicle is specified
Reply
#9

Quote:
Originally Posted by BeckzyBoi
What's advanced about it?
Well..

SetPlayerPos(pid,x,y,z) would be normal (most used)...

but..

SetSkinPlayerCarPos(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, PSkin);

the diference is advanced, at least for me.. also, it's a lot easyer and I know in this first part the functions aren't really advances but they are nice to make it faster.. And i had to choose a title for the Inc.. your comment is kinda troll.. and Spam
___________________

Quote:
Originally Posted by James_Alex
very nice
Thanx ^^

@ Weirdosport:

Thanx, I already had that but in a different context, if I make this code

SetXCarPos2( floats.. .. , interior, "Name of vehicle instead of VehId") will it work? thx
Reply
#10

It would still be better to use the vehicle ID, would save a bit of toil. Just when it comes to sending the error message, you do

VehicleNames[vehicleid - 400]

For example, dumper (id 406) -> VehicleNames[6] -> Dumper
Reply
#11

Hi.

I have made this functions:

SetCarIdPos,
SetMoneyPos
SetHealthPos
SetArmourPos

(all with strings in case of errors)

I'm working on the "SetTeamPlayerPos( blah, blah, const Team[])"

But i get this error:

pawn Код:
X:\Xxxx\Xxxx\Xxxx\pawno\include\MFC-Teleports.inc(279) : error 033: array must be indexed (variable "Team")
The files 278 to 280 are theese:

pawn Код:
TogglePlayerControllable(playerid, 1);
    if (GetPlayerTeam(playerid) == Team)
    {
btw. the command I'm using is:
pawn Код:
if(strcmp("/tele", cmdtext, true) == 0)
      {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        SetTeamPlayerPos(playerid, X, Y, Z+1000, 0.0, 0, false, "Groove");
      //SetTeamPlayerPos(playerid, x, y, z, a, interior, toggle:TeleportCar, const Team[]);
        return 1;
      }
If anyone could help.. really apreciated

See ya!
Reply
#12

Updated!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)