03.01.2017, 13:57
As per the latest SA-MP 0.3.7-R2 (for Windows), SetSpawnInfo under OnPlayerDeath works fine for me. Can anyone else confirm such an issue for both Windows and Linux? Also, are you using any plugins or includes that modifies memory or functions? This is the code I used to test on a blank gamemode:
EDIT : I've only tested with GetPlayerTeam function and it works fine. I'm not sure if this applies to the gameplay, if that's what the OP is referring to. (For instance to shoot your team mates.)
pawn Code:
#include <a_samp>
public OnPlayerSpawn(playerid) {
//If the bug persists, it shouldn't show 2.
new
temp_String[64];
format(temp_String, sizeof(temp_String), "Your team : %d", GetPlayerTeam(playerid));
SendClientMessage(playerid, -1, temp_String);
return 1;
}
public OnPlayerConnect(playerid) {
SetPlayerTeam(playerid, 1);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason) {
SetSpawnInfo(playerid, 2, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if(!strcmp(cmdtext, "/kill", true)) {
SetPlayerHealth(playerid, 0.0);
return 1;
}
if(!strcmp(cmdtext, "/changeteam", true)) {
SetPlayerTeam(playerid, 3);
return 1;
}
if(!strcmp(cmdtext, "/defaultteam", true)) {
OnPlayerConnect(playerid);
return 1;
}
if(!strcmp(cmdtext, "/spawnme", true)) {
SpawnPlayer(playerid);
return 1;
}
return 0;
}