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
#2

http://forum.sa-mp.com/showpost.php?...50&postcount=2

Also, the code in your signature has an error. It should be
pawn Код:
#define BanForHacks(%1)     (%1 * Years(1) * 32040)
Reply
#3

lmfao thanks bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)