03.12.2013, 09:49
Hello, so im having a bit of trouble with player team still being able to kill each other, It says on the samp wiki that players in the same team cannot kill each other. Is there something wrong with my code?
thank you.
pawn Код:
#define SURVIVORS 0
#define NETHERS 1
//onplayerspawn
switch(GetPlayerTeam(playerid))
{
case SURVIVORS:
{
SetPlayerTeam(playerid, SURVIVORS);
}
case NETHERS:
{
SetPlayerTeam(playerid, NETHERS);
}
}
//onplayerrequestclass
switch(classid)
{
case 0:
{
SetPlayerTeam(playerid, SURVIVORS);
GameTextForPlayer(playerid, "~b~Survivors", 1000, 6);
SetPlayerPos(playerid, 2528.9143,-1667.7504,15.1689);
SetPlayerFacingAngle(playerid, 91.28600);
SetPlayerCameraPos(playerid, 2523.7410,-1667.3444,15.0331);
SetPlayerCameraLookAt(playerid, 2528.9143,-1667.7504,15.1689);
}
case 1:
{
SetPlayerTeam(playerid, NETHERS);
GameTextForPlayer(playerid, "~r~NETHERS", 1000, 6);
SetPlayerPos(playerid, 2429.6602,-1639.7306,13.4655);
SetPlayerFacingAngle(playerid, 180.0818);
SetPlayerCameraPos(playerid, 2430.0981,-1647.5112,13.5288);
SetPlayerCameraLookAt(playerid, 2429.6602,-1639.7306,13.4655);
}
}
//i tried this command to debug it, but it works correctly (survivors get survivors returned and nethers get nether returned)
CMD:myteam(playerid, params[])
{
if(GetPlayerTeam(playerid) == 0) return SendClientMessage(playerid, -1, ""chat" "COL_GREY"You are in the survivor's team!");
if(GetPlayerTeam(playerid) == 1) return SendClientMessage(playerid, -1, ""chat" "COL_GREY"You are in the nether team!");
return 1;
}