SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 12/05/2012, 07:04 AM   #41
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: SetPlayerPosEx

Quote:
Originally Posted by SourceCode View Post
I think this belongs to Snippets and Codes , very simple one , not really worth immediately returning home for this idea
Not immediately. I smoked the whole joint lol and then i returned home.
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 30/05/2012, 12:19 PM   #42
SeoToX
Little Clucker
 
Join Date: Oct 2011
Posts: 20
Reputation: 0
Default Re: SetPlayerPosEx

pawn Code:
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, Float:a = -999, interior = -1, vw = -1)
{
    SetPlayerPos(playerid, x, y, z);

    if(a != -999)
        SetPlayerFacingAngle(playerid, a);

    if(interior != -1)
        SetPlayerInterior(playerid, interior);

    if(vw != -1)
        SetPlayerVirtualWorld(playerid, vw);

    return 1;
}
// And you can replace the original SetPlayerPos with this too
#define SetPlayerPos SetPlayerPosEx

Last edited by SeoToX; 30/05/2012 at 03:44 PM.
SeoToX is offline   Reply With Quote
Old 30/05/2012, 12:34 PM   #43
pasha97
Gangsta
 
pasha97's Avatar
 
Join Date: Feb 2012
Location: Voronezh,Russia
Posts: 651
Reputation: 60
Default Re: SetPlayerPosEx

i didnt like when i had to use 2 functions to set player pos ad facing angle, now all is in one function! Thank you!
__________________
pasha97 is offline   Reply With Quote
Old 31/05/2012, 01:30 AM   #44
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: SetPlayerPosEx

Quote:
Originally Posted by ****** View Post
Minor improvement to the redefinition to be compatible with other libraries by using ALS:

pawn Code:
#if defined _ALS_SetPlayerPos
    #undef SetPlayerPos
#else
    #define _ALS_SetPlayerPos
#endif
#define SetPlayerPos SetPlayerPosEx

This way you can actually chain multiple libraries that redefine the same symbols without problems.
I dont get that? Alex can you explain it please? Thank you brother.


Quote:
Originally Posted by pasha97 View Post
i didnt like when i had to use 2 functions to set player pos ad facing angle, now all is in one function! Thank you!
All good mate. Have fun!
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 31/05/2012, 01:41 AM   #45
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,234
Reputation: 1004
Default Re: SetPlayerPosEx

It means, with your method only one include can hook a function. Using ALS will allow multiple includes to hook/edit/whatever functions.
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 31/05/2012, 02:07 AM   #46
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: SetPlayerPosEx

Quote:
Originally Posted by MP2 View Post
It means, with your method only one include can hook a function. Using ALS will allow multiple includes to hook/edit/whatever functions.
Allright Thanks alot brother for that. Will use ALS on next update.
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 21/09/2012, 10:28 AM   #47
DeadLy™
Huge Clucker
 
DeadLy™'s Avatar
 
Join Date: May 2012
Location: New Delhi,India
Posts: 373
Reputation: 102
Default Re: SetPlayerPosEx

Nice one!
Ballu ji
__________________
LEFT
DeadLy™ is offline   Reply With Quote
Old 21/09/2012, 10:54 AM   #48
Q_Lite
Big Clucker
 
Join Date: Sep 2012
Posts: 112
Reputation: 17
Default Re: SetPlayerPosEx

useful one
Q_Lite is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:31 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.