SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 08/02/2018, 02:11 PM   #1
Milak
Little Clucker
 
Join Date: Oct 2017
Location: Poland, Gdansk
Posts: 8
Reputation: 0
Default SetSpawnInfo does not change player team(?)

I discovered, when I use SetSpawnInfo on me and I set in this Team: 0, and my friend has same team as me set by SetSpawnInfo too then if we get "GetPlayerTeam" our teams are 0, right? But callback OnPlayerGiveDamage will damage will work on us and we will damage ourself. If we USE SetPlayerTeam to me and my friend team 0 too, then it will not take any damage. So SetSpawnInfo does not work correctly - SetPlayerTeam works correctly.
Milak is offline   Reply With Quote
Old 10/02/2018, 01:34 PM   #2
Matz
Huge Clucker
 
Matz's Avatar
 
Join Date: Apr 2011
Location: Istanbul
Posts: 255
Reputation: 141
Default Re: SetSpawnInfo does not change player team(?)

I've also noticed this problem yesterday, wondering why
Matz is offline   Reply With Quote
Old 11/02/2018, 10:05 AM   #3
Milak
Little Clucker
 
Join Date: Oct 2017
Location: Poland, Gdansk
Posts: 8
Reputation: 0
Default Re: SetSpawnInfo does not change player team(?)

It's so weird! GetPlayerTeam function returns the player's team but player's team does not work correctly!
Milak is offline   Reply With Quote
Old 14/02/2018, 03:01 AM   #4
Banana_Ghost
Huge Clucker
 
Banana_Ghost's Avatar
 
Join Date: Jul 2011
Location: United States
Posts: 249
Reputation: 42
Default Re: SetSpawnInfo does not change player team(?)

If I recall correctly, SetPlayerTeam even had to be used in SA-MP 0.2. Using the team parameter in SetSpawnInfo then only allowed the usage of /tpm while using SetPlayerTeam wouldn't work for it and vise versa.
Banana_Ghost is offline   Reply With Quote
Old 14/02/2018, 03:25 AM   #5
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,009
Reputation: 155
Default Re: SetSpawnInfo does not change player team(?)

This can be fixed with 1 hook, SetSpawnInfo either by y_hooks or ALS then use SetPlayerTeam and put the team param in it, fixed. This in an include:
PHP Code:
forward SetSpawnInfoHooked(playeridteamskinFloat:xFloat:yFloat:zFloat:rotationweapon1weapon1_ammoweapon2weapon2_ammoweapon3weapon3_ammo);

public 
SetSpawnInfoHooked(playeridteamskinFloat:xFloat:yFloat:zFloat:rotationweapon1weapon1_ammoweapon2weapon2_ammoweapon3weapon3_ammo)
{
    
SetSpawnInfo(playeridteamskinFloat:xFloat:yFloat:zFloat:rotationweapon1weapon1_ammoweapon2weapon2_ammoweapon3weapon3_ammo);
    
SetPlayerTeam(playeridteam);
    return 
1;
}

#if defined _ALS_SetSpawnInfo
  #undef SetSpawnInfo
#else
    #define _ALS_SetSpawnInfo
#endif

#define SetSpawnInfo SetSpawnInfoHooked 
__________________
Quote:
Originally Posted by RogueDrifter
-You're capable of doing anything possible and logical with effort and desire despite any surrounding obstacles.
[Github]:Link [Pastebin]:Link [Forum]:Link [Server]:Link [Discord]:Link


Quote:
Originally Posted by RogueDrifter
-I'm now available to script small scripts for payments done through paypal.
RogueDrifter is online now   Reply With Quote
Old 17/02/2018, 10:03 AM   #6
BeckzyBoi
Beta Tester
 
Join Date: Dec 2006
Posts: 1,679
Reputation: 117
Default Re: SetSpawnInfo does not change player team(?)

I reported a similar, if not the same issue here:

http://forum.sa-mp.com/showthread.php?t=624667

I just use SetPlayerTeam in OnPlayerSpawn to fix it.
__________________
BeckzyBoi is offline   Reply With Quote
Old 17/02/2018, 11:00 AM   #7
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 776
Reputation: 103
Default Re: SetSpawnInfo does not change player team(?)

Use SetPlayerTeam( playerid, 255 ); when the player connects and see if it makes a difference.
__________________

developer @ ba-rp.net


http://forum.bayarearoleplay.com
Arthur Kane 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change player's team after death? KillerDVX Scripting Help 4 08/06/2015 10:28 PM
change player team Amine_Mejrhirrou Scripting Help 13 19/06/2012 02:33 AM
Saving Player Pos with Y_INI and using it with SetSpawnInfo Unfriendly Scripting Help 3 14/06/2012 09:32 AM
[Help Request] SetSpawnInfo() without team jujuv Scripting Help 8 24/04/2012 10:02 AM
Don't let the health change if player from the same team how to do that??? RyDeR` Help Archive 16 01/08/2009 12:57 PM


All times are GMT. The time now is 07:55 PM.


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