[FilterScript] m_teleport.inc
#1

The [FilterScript] tag on the topic is an accident


m_teleport.inc
This is my first include release which makes it easier and faster to make teleports.

Functions
Код:
stock Teleport(playerid, Float:x, Float:y, Float:z, Float:FacingAngle, world, interior, showmessage, message[], style, sound, camreset, telemessage, telename[], telecommand[])
playerid - The id of the player for which you want to use this function.
Float:x - x cordinates of the teleport
Float:y - y cordinates of the teleport
Float:z - z cordinates of the teleport
Float:FacingAngle - Facing angle for the teleport
world - virtual world of the teleport (set 0 for default)
interior - interior of the teleport
showmessage - toggle teleport message
message[] - the message (This is used for showing teleport name,it will only work if the "show message" is true
style - as the messsage will be in GameText so you will have to enter the style
sound - toggle playing sound on teleport
camreset - Used to set player camera behind the player
telemessage - this will show a message to all players (example: Max has teleported to "telename[]" ("telecommand[]"))
telename[] - the name of the teleport to show in the global teleport message (only works when the "telemessage" is true)
telecommand[] - the command of the teleport to show in the global teleport message (only works when the "telemessage" is true)

Usage
1.Add the m_teleport/inc in the "/pawno/includes" folder
2.Add this after a_samp include and before including m_teleport
Код:
#define TeleMessageColor 0xFFFFFFFF
(This will be used as global teleport message color if you have enabled the global message in teleport)
3.Include the m_teleport

Example Script
Код:
#include <a_samp>
#define TeleMessageColor 0x33AA33AA /*Define this before including the m_teleport include.You can use costome color,it will be used for global message color*/
#include <m_teleport>

#define FILTERSCRIPT

public OnFilterScriptInit()
{
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/teleport", cmdtext, true, 10) == 0)
	{
		Teleport(playerid,
		0,/*x cordinates*/
		0,/*y cordinates*/
		5,/*z cordinates*/
		0,/*facing angle cordinates*/
		0,/*virtual world*/
		0,/*interior*/
		true /*it will show the message as it is "true"*/,
		"Example"/*it will show a game text message to the player*/,
		6/*here we set the game test style to 6*/,
		true/*here we allowed the sound to be played*/,
		true/*it will set the players camers behind him/her */,
		true/*here we allowed the global teleport message*/,
		"Example"/*The teleport name in global message will be shown as "Example"*/,
		"/teleport"/*the teleport command in the global message will be "/teleport" now the final global message output is : "PlayerNameWillBeShowHere" teleported to Example (/teleport)*/);
		return 1;
	}
	return 0;
}
Download
Reply
#2

I suggest defining the TeleMessageColor color if not defined, ex:
pawn Код:
#if !defined TeleMessageColor
     #define TeleMessageColor 0xFFFFFFFF
#endif
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
I suggest defining the TeleMessageColor color if not defined, ex:
pawn Код:
#if !defined TeleMessageColor
     #define TeleMessageColor 0xFFFFFFFF
#endif
Thanks,i will add in next update
Reply
#4

I suggest making it unique. One way of doing so would be adding more than just messages. You may want to look into fading the screen with textdraws, that'd be a step closer to awesome.
Reply
#5

Mm not bad,add vehicle teleport in params,bool to teleport vehicle if he's inside one
Reply
#6

Quote:
Originally Posted by Roberto80
Посмотреть сообщение
Mm not bad,add vehicle teleport in params,bool to teleport vehicle if he's inside one
I skipped that because i was bored.

Quote:
Originally Posted by Crayder
Посмотреть сообщение
I suggest making it unique. One way of doing so would be adding more than just messages. You may want to look into fading the screen with textdraws, that'd be a step closer to awesome.
I am a noob at textdraws so i diden't used it. lol
Reply
#7

Quote:
Originally Posted by Fancy
Посмотреть сообщение
I skipped that because i was bored.


I am a noob at textdraws so i diden't used it. lol
Creating a single textdraw over the screen isn't as complicated you think. I've been where you are, you won't learn it unless you do it. Try it, look at examples, look at other scripts (screenfader)...
Reply
#8

Quote:
Originally Posted by Crayder
Посмотреть сообщение
I suggest making it unique. One way of doing so would be adding more than just messages. You may want to look into fading the screen with textdraws, that'd be a step closer to awesome.
Is not an bad idea you realease something like that :P like dynamic entrances...

-

OP:

Nice work, you can improve with Crayder sugestions.
Reply
#9

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Creating a single textdraw over the screen isn't as complicated you think. I've been where you are, you won't learn it unless you do it. Try it, look at examples, look at other scripts (screenfader)...
Quote:
Originally Posted by PT
Посмотреть сообщение
Is not an bad idea you realease something like that :P like dynamic entrances...

-

OP:

Nice work, you can improve with Crayder sugestions.
Alright
But explain me where to add screen fade?
Reply
#10

Since there's an arugment called "telecommand" you can even create automatic commands that are created by using your function. Under OnPlayerCommandText or OnPlayerCommandPerformed (If you're using zcmd), you can loop through your teleport data and see if a command matches, if then find the array index and perform the teleport function.

There's an include released here before which is similar to your include, I still remember suggesting what I've mentioned now. The author of that include updated it and it works well!
Reply
#11

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
Since there's an arugment called "telecommand" you can even create automatic commands that are created by using your function. Under OnPlayerCommandText or OnPlayerCommandPerformed (If you're using zcmd), you can loop through your teleport data and see if a command matches, if then find the array index and perform the teleport function.

There's an include released here before which is similar to your include, I still remember suggesting what I've mentioned now. The author of that include updated it and it works well!
I made it for custom text because some people don't want to show the command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)