Closest Player
#1

Hey,

How would I get the closest police officer for a use to pay his ticket? This is my code:
pawn Код:
CMD:pay(playerid,params[])
{
    if(gTeam[playerid] == TEAM_CIVIL || PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(HasATicket[playerid] == 1)
        {
            new Rand1, Rand2, Rand3;
            Rand1 = random(5000);
            Rand2 = random(15000);
            Rand3 = random(30000);
            switch(GetPlayerWantedLevel(playerid))
            {
                case 0: SendClientMessage(playerid,COLOR_RED,"You are not currently wanted.");
                case 1: GivePlayerMoney(playerid,Rand1);
                case 2: GivePlayerMoney(playerid,Rand2);
                case 3: GivePlayerMoney(playerid,Rand3);
            }
        }
        else return SendClientMessage(playerid,COLOR_RED,"You have not been issued a ticket");
    }
    else return SendClientMessage(playerid,COLOR_RED,"You are not a civilian");
    return 1;
}
As you can see there is no way of getting the closest police officer or medic. How would I do this? Thanks!
Reply


Messages In This Thread
Closest Player - by DarkKillerWithPride<3 - 06.01.2012, 01:05
Re: Closest Player - by [HiC]TheKiller - 06.01.2012, 01:16
Re: Closest Player - by DarkKillerWithPride<3 - 06.01.2012, 01:18

Forum Jump:


Users browsing this thread: 1 Guest(s)