SetSpawnInfo does not change player team(?)
#8

Quote:
Originally Posted by RogueDrifter
View Post
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 
This wouldn't be fully correct either. SetSpawnInfo shouldn't set the team when called, it should set the team on the next respawn. Furthermore you can make a much easier fix by doing this in OnPlayerSpawn:

Code:
public OnPlayerSpawn(playerid)
{
SetPlayerTeam(playerid, GetPlayerTeam(playerid));
}
Since GetPlayerTeam returns the correct value, you can just update it, like BeckzyBoi mentioned.
Reply


Messages In This Thread
SetSpawnInfo does not change player team(?) - by Milak - 08.02.2018, 13:11
Re: SetSpawnInfo does not change player team(?) - by Matz - 10.02.2018, 12:34
Re: SetSpawnInfo does not change player team(?) - by Milak - 11.02.2018, 09:05
Re: SetSpawnInfo does not change player team(?) - by Banana_Ghost - 14.02.2018, 02:01
Re: SetSpawnInfo does not change player team(?) - by RogueDrifter - 14.02.2018, 02:25
Re: SetSpawnInfo does not change player team(?) - by beckzy - 17.02.2018, 09:03
Re: SetSpawnInfo does not change player team(?) - by Kane - 17.02.2018, 10:00
Re: SetSpawnInfo does not change player team(?) - by NaS - 17.02.2018, 22:12
Re: SetSpawnInfo does not change player team(?) - by RogueDrifter - 17.02.2018, 22:15

Forum Jump:


Users browsing this thread: 1 Guest(s)