20.01.2013, 10:36
Hello, today I wanna show you my first include DZ_Functions, that can make scripting easier for everyone!
* * * How can this Include help me to script?
This Include has some different functions, which short-up the actually functions by SA-MP and some different functions which are easier to remember. Among other some functions got together. So you don't have to write so much.
Example 1: Some functions in one!
Imagine you wanna create a teleport command, and you have to use functions like SetPlayerPos, SetPlayerFacingAngle or/and SetCameraBehindPlayer. Somewhere it is absurd three or more functions (Maybe SetPlayerInterior or something like that) to write, so why not everything in only one line? And here can DZ_Functions help you, because these funcions are already in one:
SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:A)! ("SetPlayerPosEx" is using SetCameraBehindPlayer and SetPlayerInterior, too)
Example 2: Hard to remember Features in Focus!
Imagine you wanna freeze a player per command, how would you script that? Right, with TogglePlayerControllable. For some new scripters is this function too hard to remember, so I changed TogglePlayerControllable to FreezePlayer, because I think everyone can remember that easier than TogglePlayerControllable. So DZ_Functions helps here too with the Function (Un)FreezePlayer!
* * * How can I install this include?
Download the Include (Look at the end of this post) and put in the DZ_Functions.inc in the pawno\include folder. Have you done it, open your script and write there at the first lines where your other includes are: #include <dz_functions>! If you done it, should the Include normally work(Insofar you use the Functions in your script too). Should there be problems with the Include or with installing, post it here.
* * * Which functions use this Include?
* * * Downloads:
Pastebin: http://pastebin.com/dykHJXjU
Solidfiles: http://www.solidfiles.com/d/0cc6326556/
Please post bugs or suggestions here!
Greezz, DarkZero
* * * How can this Include help me to script?
This Include has some different functions, which short-up the actually functions by SA-MP and some different functions which are easier to remember. Among other some functions got together. So you don't have to write so much.
Example 1: Some functions in one!
Imagine you wanna create a teleport command, and you have to use functions like SetPlayerPos, SetPlayerFacingAngle or/and SetCameraBehindPlayer. Somewhere it is absurd three or more functions (Maybe SetPlayerInterior or something like that) to write, so why not everything in only one line? And here can DZ_Functions help you, because these funcions are already in one:
SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:A)! ("SetPlayerPosEx" is using SetCameraBehindPlayer and SetPlayerInterior, too)
Example 2: Hard to remember Features in Focus!
Imagine you wanna freeze a player per command, how would you script that? Right, with TogglePlayerControllable. For some new scripters is this function too hard to remember, so I changed TogglePlayerControllable to FreezePlayer, because I think everyone can remember that easier than TogglePlayerControllable. So DZ_Functions helps here too with the Function (Un)FreezePlayer!
* * * How can I install this include?
Download the Include (Look at the end of this post) and put in the DZ_Functions.inc in the pawno\include folder. Have you done it, open your script and write there at the first lines where your other includes are: #include <dz_functions>! If you done it, should the Include normally work(Insofar you use the Functions in your script too). Should there be problems with the Include or with installing, post it here.
* * * Which functions use this Include?
pawn Code:
native SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:A);
native SetPlayerInteriorEx(playerid, InteriorID, Float:X, Float:Y, Float:Z, Float:A);
native SetPlayerWorld(playerid, Virtualworld, Float:X, Float:Y, Float:Z, Float:A); //
native SetPlayerInteriorWorld(playerid, Virtualworld, InteriorID, Float:X, Float:Y, Float:Z, Float:A);
native SetVehiclePosEx(playerid, Float:X, Float:Y, Float:Z, Float:A);
native SetVehicleWorld(playerid, Virtualworld, Float:X, Float:Y, Float:Z, Float:A);
native GetPlayerIpEx(playerid);
native GetPlayerNameEx(playerid);
native FreezePlayer(playerid);
native UnfreezePlayer(playerid);
native HealPlayer(playerid);
native KillPlayer(playerid);
* * * Downloads:
Pastebin: http://pastebin.com/dykHJXjU
Solidfiles: http://www.solidfiles.com/d/0cc6326556/
Please post bugs or suggestions here!
Greezz, DarkZero