06.04.2013, 21:51
Hello SA:MP Community,
I've a little problem. I did a Capture The Flag System. It's working perfect but I have a strange bug which I'm trying to solve for almost 4 hours.
Indeed, in my game there are 2 team (Red & Blue). I wanna hide the blue players (in the mini map) for red players and hide the red players for the blue players.
My code is currently hiding only red players for blue players.
Here is my function.
Thanks for help.
I've a little problem. I did a Capture The Flag System. It's working perfect but I have a strange bug which I'm trying to solve for almost 4 hours.
Indeed, in my game there are 2 team (Red & Blue). I wanna hide the blue players (in the mini map) for red players and hide the red players for the blue players.
My code is currently hiding only red players for blue players.
Here is my function.
Код:
// Function to teleport the player to his base
GXTeleportPlayerCTF(playerid)
{
// Red team
if(AllPlayers[playerid][PlayerEventTeam] == 1)
{
// Set Player Team
SetPlayerTeam(playerid,15);
// Teleport
SetPlayerVirtualWorld(playerid,56);
SetPlayerPos(playerid,230.3188, 250.3898, 60.7265);
SetPlayerFacingAngle(playerid,2.3934);
// Set checkpoint
SetPlayerCheckpoint(playerid, 228.9879, 274.0908, 57.1859, 3.0);
// Set player color
SetPlayerColor(playerid, 0xFF000000);
// Set map icon
SetPlayerMapIcon(playerid, 99, 360.8691, 593.2734, 54.4642, 19, 0, MAPICON_GLOBAL);
}
// Blue team
if(AllPlayers[playerid][PlayerEventTeam] == 2)
{
// Set Player Team
SetPlayerTeam(playerid,16);
SetPlayerVirtualWorld(playerid,56);
// Teleport
SetPlayerPos(playerid,393.3380, 594.2791, 56.4628);
SetPlayerFacingAngle(playerid,92.3388);
// Set checkpoint
SetPlayerCheckpoint(playerid, 360.8691, 593.2734, 54.4642, 3.0);
// Set player color
SetPlayerColor(playerid, 0x000066FF);
// Set map icon
SetPlayerMapIcon(playerid, 99, 228.9879, 274.0908, 57.1859, 19, 0, MAPICON_GLOBAL);
}
// Join minigame
GXGoingToMiniGame(playerid);
// Give back weapons
if(EventStarted)
{
// AK47
GivePlayerWeapon(playerid,30,10000);
// Deagle
GivePlayerWeapon(playerid,24,10000);
// Shotgun
GivePlayerWeapon(playerid,25,10000);
// Sniper
GivePlayerWeapon(playerid,34,19000);
}
// Hide markers
for(new j=0; j<MAX_PLAYERS; j++)
{
if(AllPlayers[j][PlayerIsInEvent])
{
if(AllPlayers[playerid][PlayerEventTeam] != AllPlayers[j][PlayerEventTeam])
{
// Hide enemy for the player
SetPlayerMarkerForPlayer(playerid, j, ( GetPlayerColor(j)&0xFFFFFF00));
// Hide player for enemy
SetPlayerMarkerForPlayer(j, playerid, ( GetPlayerColor(playerid)&0xFFFFFF00));
}
}
}
}

