[Ajuda] Dar nivel de Proc
#1

й Possivel dar nivel de procurado a todos os players que estiverem proximos ao lugar do roubo ? tipo roubar a loterica , ai todos que estгo proximos ao cofre recebem nivel de proc ?
Reply
#2

Use IsPlayerInRangeOfPoint juntamente com um loop.
Reply
#3

pawn Код:
new a = 0, b = GetMaxPlayers();
for( ; a != b; ++a ) {
   if(IsPlayerInRangeOfPoint(a, 15.0, roubox, rouboy, rouboz)) {
          //
   }
}
Reply
#4

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 20, X, Y, Z)) //Local do roubo
    {
        new string[3] = GetPlayerWantedLevel(i);
        SetPlayerWantedLevel(i, string+1);
    }
}
Reply
#5

Quote:
Originally Posted by paulor
Посмотреть сообщение
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 20, X, Y, Z)) //Local do roubo
    {
        new string[24] = GetPlayerWantedLevel(i);
        SetPlayerWantedLevel(i, string+1);
    }
}
Para que reservar 24 cells?
Reply
#6

blz mudei la.
Reply
#7

Quote:
Originally Posted by paulor
Посмотреть сообщение
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 20, X, Y, Z)) //Local do roubo
    {
        new string[3] = GetPlayerWantedLevel(i);
        SetPlayerWantedLevel(i, string+1);
    }
}
Ae Paulor , deu erro .. :/

pawn Код:
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : error 008: must be a constant expression; assumed zero
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45275) : error 033: array must be indexed (variable "string")
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45276) : error 033: array must be indexed (variable "string")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
o Comando estб assim :
pawn Код:
if(strcmp(cmd, "/fugir", true) == 0)
    {
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972)) //Local do roubo
    {
        new string[3] = GetPlayerWantedLevel(i);
        SetPlayerWantedLevel(i, string+1);
        SetPlayerWantedLevel(i, string+1);
        PlayerInfo[i][pJailed] = 0;
        PlayerInfo[giveplayerid][pJailTime] = 0;
        GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);
    format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);
    BroadCast(COLOR_OOC,string);
    }
}
return 1;
    }
P.S: Й um comando para fugir da prisгo kk xD
Reply
#8

Tenta pra ver se da certo aii, deixa como tava sem ERRO e troca por isso :


pawn Код:
if(strcmp(cmd, "/fugir", true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972))
        {
            new string[3] = GetPlayerWantedLevel(i);
            SetPlayerWantedLevel(i, string+1);
            SetPlayerWantedLevel(i, string+1);
            PlayerInfo[i][pJailed] = 0;
            PlayerInfo[giveplayerid][pJailTime] = 0;
            SetPlayerCriminal(playerid,255, "Pega ***** Mlq Pilota");//Pra da nivel de procurado
            GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);
            format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);
            BroadCast(COLOR_OOC,string);
        }
    }
    return 1;
 }


Ajudei ? +Reputa...
Reply
#9

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
pawn Код:
new string = GetPlayerWantedLevel(i);
Quote:
Originally Posted by Tiger_xD
Посмотреть сообщение
Tenta pra ver se da certo aii, deixa como tava sem ERRO e troca por isso :


pawn Код:
if(strcmp(cmd, "/fugir", true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972))
        {
            new string[3] = GetPlayerWantedLevel(i);
            SetPlayerWantedLevel(i, string+1);
            SetPlayerWantedLevel(i, string+1);
            PlayerInfo[i][pJailed] = 0;
            PlayerInfo[giveplayerid][pJailTime] = 0;
            SetPlayerCriminal(playerid,255, "Pega ***** Mlq Pilota");//Pra da nivel de procurado
            GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);
            format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);
            BroadCast(COLOR_OOC,string);
        }
    }
    return 1;
 }


Ajudei ? +Reputa...
Deu erro nos 2
pawn Код:
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45274) : error 008: must be a constant expression; assumed zero
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45275) : error 033: array must be indexed (variable "string")
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp1.pwn(45276) : error 033: array must be indexed (variable "string")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#10

Deixa so o comando que vou passar e ver se da Certo?


pawn Код:
if(strcmp(cmd, "/fugir", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(i, 20, 716.8190,-3481.3455,3.8972))
        {
            PlayerInfo[i][pJailed] = 0;//Pra Tirar o Tempo
            PlayerInfo[giveplayerid][pJailTime] = 1;//Deixa assim
            SetPlayerCriminal(playerid,255, "Pega ***** Mlq Pilota");//Pra da nivel de procurado
            GameTextForPlayer(i, "Foi iniciada uma Fuga", 5000, 3);//Messagem de Fuga
            format(string, 256, "[Noticia Criminal] %s iniciou uma Fuga de Alcatraz", giveplayer);//Messagem pra todos sobre fuga '-'
            BroadCast(COLOR_OOC,string);
        }
    }
    return 1;
 }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)