[Ajuda] Policias proximos
#1

Fiz isto para apуs o player vender drogas policiasi proximos serem avisados,mas depois da venda todos policias sгo avisados e eu recebo o level de procurado.
Queria que isso sу mande a mensagem para policias proximos a 500 metros.GM PPC_TRUCKING.

pawn Код:
forward vendeu(playerid);
public vendeu(playerid)
{
    new Name[24], targetid, location[MAX_ZONE_NAME], Msg[128];
    for(new i; i < GetMaxPlayers(); i++){if(IsPlayerConnected(i))
    {
    new Float:PosX, Float:PosY, Float:PosZ;
    GetPlayerPos(playerid, PosX, PosY, PosZ);
    if(IsPlayerInRangeOfPoint(APlayerData[i][PlayerClass] == ClassPolice, 500.0, PosX, PosY, PosZ))
    {
    GetPlayerName(playerid, Name, sizeof(Name));
    GetPlayer2DZone(targetid, location, MAX_ZONE_NAME);
    format(Msg, 128, "{FFFFFF}%s {0000FF}esta vendendo drogas em{ffffff}%s", Name, location);
    Police_SendMessage(Msg);
    SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
    APlayerData[playerid][PoliceCanJailMe] = true;
    }
    }
    }
    return 1;
}
Reply
#2

PHP код:
forward vendeu(playerid);
public 
vendeu(playerid)
{
    new 
Name[24], targetidlocation[MAX_ZONE_NAME], Msg[128];
    for(new 
iGetMaxPlayers(); i++)
    {
        if(
IsPlayerConnected(i))
        {
            new 
Float:PosXFloat:PosYFloat:PosZ;
            
GetPlayerPos(playeridPosXPosYPosZ);
            if(
IsPlayerInRangeOfPoint(i500.0PosXPosYPosZ) && APlayerData[i][PlayerClass] == ClassPolice)
            {
                
GetPlayerName(playeridNamesizeof(Name));
                
GetPlayer2DZone(targetidlocationMAX_ZONE_NAME);
                
format(Msg128"{FFFFFF}%s {0000FF}esta vendendo drogas em{ffffff}%s"Namelocation);
                
Police_SendMessage(Msg);
                
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid) + 1);
                
APlayerData[playerid][PoliceCanJailMe] = true;
            }
        }
    }
    return 
1;

Tente assim
Reply
#3

Funcionou amigo obg.+REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)