PDA

View Full Version : [Include] [INC] Advanced Teleports! V. 1.0


MarcoNecroX
12/05/2009, 10:51 PM
Advanced Teleports - Include by [MFC]Sylar - Version 1.00!

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:


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;


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.
_________________________________________________


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:

SetOnFootPos(playerid, 2014.254, 1024.2521, 321.45255, 210.0, 0);

_________________________________________________


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.

SetCarPos(playerid, 531.0353, 3421.0355, 321.3503, 214.0, 2014.254, 1024.2521, 321.45255, 0)

_________________________________________________

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.

SetXCarPos(playerid, 531.0353, 3421.0355, 321.3503, 214.0, 2014.254, 1024.2521, 321.45255, 0, 288)

_________________________________________________

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.

_________________________________________________

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.

_________________________________________________

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.

_________________________________________________

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.

SetHealthPos(playerid, 325.3212, 321.242, 102.254, 90.0, 0, true, 100.0);

_________________________________________________

SetArmourPos(playerid, Float:Px, Float:Py, Float:Pz, Float:Pa, interior, toggle:TeleportCar, Float:Armour);

Same as above, but using Armour.

_________________________________________________

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.

_________________________________________________

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.

_________________________________________________

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!

_________________________________________________
_________________________________________________

Getting Started!:

First of All, download this:

http://solidfiles.com/info_imgs/UdAb.jpg (http://solidfiles.com/d/UdAb)

In your script:

_________________________________________________

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


#include <MFC-Teleports> // Advanced Teleports by [MFC]Sylar


_________________________________________________

Two examples to know how to use this Cmd's: (in different contexts)

In a Menu:

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:

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;
}


_________________________________________________
_________________________________________________

Also you can add in your script:

At the top:

#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 :roll:

Example:


#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!

_________________________________________________
_________________________________________________

In the future Versions:


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

_________________________________________________
_________________________________________________

Notes:
1) Sorry for my bad English :lol:
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 :D
6) Click Here (http://weedarr.wikidot.com/system:list-all-pages) if you wanna know the ID's of anything you want (interiors, cars, skins, etc.)

_________________________________________________
_________________________________________________

Hope you all like it, is my first include :lol:

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

See ya!!!!

_________________________________________________

[MFC]Sylar

*ToM*
12/05/2009, 10:58 PM
pretty OK, well done

Weirdosport
13/05/2009, 11:16 AM
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.

hk_shade
13/05/2009, 01:43 PM
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.

MarcoNecroX
13/05/2009, 06:21 PM
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.

BeckzyBoi
13/05/2009, 07:23 PM
What's advanced about it?

James_Alex
13/05/2009, 08:35 PM
very nice 8)

Weirdosport
13/05/2009, 09:32 PM
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

MarcoNecroX
13/05/2009, 09:34 PM
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
___________________


very nice 8)


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

Weirdosport
13/05/2009, 09:41 PM
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

MarcoNecroX
14/05/2009, 04:36 AM
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:

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:


TogglePlayerControllable(playerid, 1);
if (GetPlayerTeam(playerid) == Team)
{


btw. the command I'm using is:

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 :D

See ya!

MarcoNecroX
15/05/2009, 04:02 AM
Updated! :D