Failure of creating a UAV System
#1

I have tried to create a UAV System (and I was infact hesitant to post my attempts here) but it doesn't work. I type /uav and get the message "Friendly UAV Online!" but neither the enemies nor the friends do not show up on my radar.

pawn Код:
if(strcmp(cmdtext, "/uav", true, 3) == 0)
    {
        if(playerInfo[playerid][UAV] == 1)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Friendly UAV Online!");
            playerInfo[playerid][UAV] = 0;
            for(new i; i>MAX_PLAYERS; i++) {
                if(!hasDied[i]) {
                    if(gTeam[i] == gTeam[playerid]) {
                        SetPlayerMarkerForPlayer( playerid, i, GetColorForTeam(gTeam[playerid]) );
                        for(new j; j>MAX_PLAYERS; j++) {
                            if(!hasDied[i]) {
                                if(gTeam[j] == gTeam[i]) {
                                    SetPlayerMarkerForPlayer( i, j, GetColorForTeam(gTeam[j]) );
                                    SendClientMessage(i, 0xFFFFFFFF, "{00FF00}Friendly UAV Online!");
                                } else if(gTeam[j] != gTeam[i]) {
                                    SetPlayerMarkerForPlayer( i, j, GetColorForTeam(gTeam[j]) );
                                    SendClientMessage(j, 0xFFFFFFFF, "{FF0000}Enemy UAV Online!");
                                }
                            }
                        }
                    } else if(gTeam[i] != gTeam[playerid]) {
                        SetPlayerMarkerForPlayer( playerid, i, GetColorForTeam(gTeam[i]) );
                        SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Enemy UAV Online!");
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/uav", true))
{
    if(playerInfo[playerid][UAV] == 1)
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Friendly UAV Online!");
        playerInfo[playerid][UAV] = 0;
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(!hasDied[i])
            {
                if(gTeam[i] == gTeam[playerid])
                {
                    if(i != playerid)
                    {
                        SendClientMessage(i, 0xFFFFFFFF, "{00FF00}Friendly UAV Online!");
                        SetPlayerMarkerForPlayer( playerid, i, GetColorForTeam(gTeam[playerid]) );
                        for(new j; j<MAX_PLAYERS; j++)
                        {
                            if(!hasDied[j])
                            {
                                if(gTeam[j] == gTeam[i])
                                    SetPlayerMarkerForPlayer( i, j, GetColorForTeam(gTeam[i]) );
                                else
                                    SetPlayerMarkerForPlayer( i, j, GetColorForTeam(gTeam[j]) );
                            }
                        }
                    }
                }
                else
                {
                    SetPlayerMarkerForPlayer( playerid, i, GetColorForTeam(gTeam[i]) );
                    SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Enemy UAV Online!");
                }
            }
        }
    }
    return 1;
}
Been outta pawn for a few months but give it a whirl. Not efficient but should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)