[Ajuda] Caixinha de Presente
#1

A caixinha de presente ja veio no gm! sу que queria que sу desse para pegar a caixinha com certo players conectados
Exemplo: Vocк sу pode pegar a Caixinha com 10 Players online.

codigo!!!
PHP код:
      }
    if(
PlayerToPoint(2.0,playerid,386.5930,-2028.4550,7.8359) || PlayerToPoint(1.0,playerid,-2305.1135,150.0425,35.3125))
        {
            new 
DinheiroCaixinha 1000 random(20000);
            new 
RespeitoCaixinha random(5);
            if(
PlayerInfo[playerid][pCaixinha] == char)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк pegou uma Caixinha hб pouco tempo, volte novamente apуs o prуximo salбrio!");
                return 
1;
            }
            else
            {
                new 
string[128];
                
PlayerInfo[playerid][pCaixinha] = char;
                
format(stringsizeof(string), "Player: [%s] pegou uma Caixinha, %d de dinheiro e %d de respeito, Corra para Pegar a Sua !.",PlayerName(playerid),DinheiroCaixinhaRespeitoCaixinha);
                 
SendClientMessageToAll(COR_COSA,string);
                 
GivePlayerMoney(playeridDinheiroCaixinha);
                
PlayerInfo[playerid][pExp] += RespeitoCaixinha;
                
SendClientMessage(playeridCOR_BALLAS"{A020F0}Vocк ganhou uma caixinha de presente,volte novamento apуs o prуximo salбrio!");
                
format(stringsizeof(string), "{A020F0}Na caixinha continha %d de dinheiro e %d de respeito !",
                 
DinheiroCaixinhaRespeitoCaixinha);
                 
SendClientMessage(playeridCOR_BALLASstring);
            }
        } 
Ajuda ai gentee!!!
Reply
#2

Crie uma variбvel para contar quantos players tem no server.
Topo do GM:
pawn Код:
new Online;
Em OnPlayerConnected:
pawn Код:
Online ++;
OnPlayerDisconnected:
pawn Код:
Online --;
Para ver se tem 10 players online:
pawn Код:
if(Online >= 10)
Reply
#3

nгo deu nao jovem!
explica melhor
Reply
#4

pawn Код:
if(Online >= 10) return SendClientMessage(playerid,-1,"o Server nгo atingiu o numero de players suficientes para pegar a Caixinha!);
Basta Colocar isso No Comando,Bem Fбcil e Sу Tentar .
Reply
#5

Ela compilo de boa sу que nao funciona!
Reply
#6

nгo da para usar uma funзao que ja esteja em meu gm!

tipo

PHP код:
    if(strcmp(cmdtext"/online"true) == 0)
    {
        if(
PlayerInfo[playerid][pAdmin] < 1337)
        {
            
SendClientMessage(playerid0xB22222FF"Vocк nгo tem permissгo para usar esse comando.");
            return 
1;
        }
if(
admtrampando[playerid] < 1)
        {
            
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/trabalhar)");
            return 
1;
        }
        
format(gstringsizeof(gstring), "Server: [%d] Players Online."ContarJogadores());
        
SendClientMessageToAll(COLOR_LIGHTBLUEgstring);
        return 
1;
    } 
esse й um sistema que mostra quantos player online tem no server. ajuda?
Reply
#7

compilo sу que nгo esta funcionando!

PHP код:
new Online
PHP код:
    if(PlayerToPoint(2.0,playerid,386.5930,-2028.4550,7.8359) || PlayerToPoint(1.0,playerid,-2305.1135,150.0425,35.3125))
        {
            if(
Online >= 10) return SendClientMessage(playerid,-1,"o Server nгo atingiu o numero de players suficientes para pegar a Caixinha! (10 Players)");
            new 
DinheiroCaixinha 1000 random(20000);
            new 
RespeitoCaixinha random(5);
            if(
PlayerInfo[playerid][pCaixinha] == char)
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк pegou uma Caixinha hб pouco tempo, volte novamente apуs o prуximo salбrio!");
                return 
1;
            }
            else
            {
                new 
string[128];
                
PlayerInfo[playerid][pCaixinha] = char;
                
format(stringsizeof(string), "Player: [%s] pegou uma Caixinha, %d de dinheiro e %d de respeito, Corra para Pegar a Sua !.",PlayerName(playerid),DinheiroCaixinhaRespeitoCaixinha);
                 
SendClientMessageToAll(COR_COSA,string);
                 
GivePlayerMoney(playeridDinheiroCaixinha);
                
PlayerInfo[playerid][pExp] += RespeitoCaixinha;
                
SendClientMessage(playeridCOR_BALLAS"{A020F0}Vocк ganhou uma caixinha de presente,volte novamento apуs o prуximo salбrio!");
                
format(stringsizeof(string), "{A020F0}Na caixinha continha %d de dinheiro e %d de respeito !",
                 
DinheiroCaixinhaRespeitoCaixinha);
                 
SendClientMessage(playeridCOR_BALLASstring);
            }
        } 
Reply
#8

pawn Код:
if(PlayerToPoint(2.0,playerid,386.5930,-2028.4550,7.8359) || PlayerToPoint(1.0,playerid,-2305.1135,150.0425,35.3125))
        {
            if(Online < 10) return SendClientMessage(playerid,-1,"o Server nгo atingiu o numero de players suficientes para pegar a Caixinha! (10 Players)");
            new DinheiroCaixinha = 1000 + random(20000);
            new RespeitoCaixinha = random(5);
            if(PlayerInfo[playerid][pCaixinha] == char)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк pegou uma Caixinha hб pouco tempo, volte novamente apуs o prуximo salбrio!");
                return 1;
            }
            else
            {
                new string[128];
                PlayerInfo[playerid][pCaixinha] = char;
                format(string, sizeof(string), "Player: [%s] pegou uma Caixinha, %d de dinheiro e %d de respeito, Corra para Pegar a Sua !.",PlayerName(playerid),DinheiroCaixinha, RespeitoCaixinha);
                 SendClientMessageToAll(COR_COSA,string);
                 GivePlayerMoney(playerid, DinheiroCaixinha);
                PlayerInfo[playerid][pExp] += RespeitoCaixinha;
                SendClientMessage(playerid, COR_BALLAS, "{A020F0}Vocк ganhou uma caixinha de presente,volte novamento apуs o prуximo salбrio!");
                format(string, sizeof(string), "{A020F0}Na caixinha continha %d de dinheiro e %d de respeito !",
                 DinheiroCaixinha, RespeitoCaixinha);
                 SendClientMessage(playerid, COR_BALLAS, string);
            }
        }
Reply
#9

Ae deu certo Vlww manoo
Reply
#10

Ok...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)