• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] turf system
#2
Try this

Code:
forward OnPlayerEnterTurf(playerid, turf);
public OnPlayerEnterTurf(playerid, turf)
{
    if(turf != -1)
    {
        new string[128];
        if(GetPVarInt(playerid, "TurfsTD") == 1)
        {
            if(TurfsInfo[turf][TurfsGang] != 255)
            {
                new hex, str[32];
                format(str, sizeof(str), "%x", FamilyInfo[TurfsInfo[turf][TurfsGang]][FamilyBandana]);
                sscanf(str, "x", hex);
                format(string, sizeof(string), "%s", FamilyInfo[TurfsInfo[turf][TurfsGang]][FamilyName]);
                PlayerTextDrawColor(playerid, Textdraw1s[playerid], hex);
                PlayerTextDrawSetString(playerid, Textdraw1s[playerid], string);
                PlayerTextDrawHide(playerid, Textdraw1s[playerid]);
                PlayerTextDrawShow(playerid, Textdraw1s[playerid]);
            }
            else
            {
                PlayerTextDrawSetString(playerid, Textdraw1s[playerid], "Neutral");
                PlayerTextDrawColor(playerid, Textdraw1s[playerid], -1);
                PlayerTextDrawHide(playerid, Textdraw1s[playerid]);
                PlayerTextDrawShow(playerid, Textdraw1s[playerid]);
            }

            TextDrawShowForPlayer(playerid, Textdraw0s);
        }

        if(TurfsInfo[turf][TurfsDoing] == 1)
        {
            if(PlayerInfo[playerid][pGang] < 255)
            {
                foreach(Player, i)
                {
                    if(InTurf[i] == turf)
                    {
                        if(PlayerInfo[i][pGang] < 255)
                        {
                            SetPlayerMarkerForPlayer(playerid, i, FamilyInfo[PlayerInfo[i][pGang]][FamilyBandana]);
                            pBandana[i] = 1;
                        }
                        
                        if(PlayerInfo[i][pFaction] > 0)
                        {
                            SetPlayerMarkerForPlayerEx(playerid, i);
                            pBandana[i] = 1;
                        }

                        SetPlayerMarkerForPlayer(i, playerid, FamilyInfo[PlayerInfo[playerid][pGang]][FamilyBandana]);
                        pBandana[playerid] = 1;
                    }
                }
            }

            if(PlayerInfo[playerid][pFaction] > 0)
            {
                foreach(Player, i)
                {
                    if(InTurf[i] == turf)
                    {
                        if(PlayerInfo[i][pGang] < 255)
                        {
                            SetPlayerMarkerForPlayer(playerid, i, FamilyInfo[PlayerInfo[i][pGang]][FamilyBandana]);
                            pBandana[i] = 1;
                        }
                        
                        if(PlayerInfo[i][pFaction] > 0)
                        {
                            SetPlayerMarkerForPlayerEx(playerid, i);
                            pBandana[i] = 1;
                        }

                        SetPlayerMarkerForPlayerEx(i, playerid);
                        pBandana[playerid] = 1;
                    }
                }
            }
        }
    }
    return 1;
}
  Reply


Messages In This Thread
turf system - by Sizy - 2024-05-16, 07:01 AM
RE: turf system - by N0FeaR - 2024-05-20, 06:43 PM

Forum Jump: