if(strcmp(cmd, "/vendermaconha", true) == 0)
{
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode vender drogas na cadeia!");
return 1;
}
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMembro] == 19 || PlayerInfo[playerid][pLider] == 19 || PlayerInfo[playerid][pMembro] == 18 || PlayerInfo[playerid][pLider] == 18 || PlayerInfo[playerid][pMembro] == 17 || PlayerInfo[playerid][pLider] == 17 || PlayerInfo[playerid][pMembro] == 14 || PlayerInfo[playerid][pLider] == 14 || PlayerInfo[playerid][pMembro] == 5 || PlayerInfo[playerid][pLider] == 5)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um Gangster !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /venderdrogas [id] [quantidade] [preco]");
return 1;
}
new playa;
new money;
new needed;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
needed = strval(tmp);
if(needed < 1 || needed > 99) { SendClientMessage(playerid, COLOR_GREY, " Minimo de Pedras 1, e Maximo de Pedras 99!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { return 1; }
money = strval(tmp);
if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " Preco maior que 1, menor que 99999!"); return 1; }
if(needed > PlayerInfo[playerid][pDrogas]) { SendClientMessage(playerid, COLOR_GREY, " Vocк nao tem esta quantidade de pedras com Vocк !"); return 1; }
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, playa))
{
if(playa == playerid)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo pode vender maconha pra vocк mesmo!");
return 1;
}
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vocк ofereceu %s com %d pedras por R$%d .", giveplayer, needed, money);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* O Traficante %s quer vender %d pedras por R$%d, (Digite /aceitar maconha) para comprar.", sendername, needed, money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
DrugOffer[playa] = playerid;
DrugPrice[playa] = money;
DrugGram[playa] = needed;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador nгo estб perto de vocк !");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Jogador offline.");
}
}
return 1;
}
PlayerInfo[playerid][pMembro] == 19 || PlayerInfo[playerid][pLider] == 19 || PlayerInfo[playerid][pMembro] == 18 || PlayerInfo[playerid][pLider] == 18 || PlayerInfo[playerid][pMembro] == 17 || PlayerInfo[playerid][pLider] == 17 || PlayerInfo[playerid][pMembro] == 14 || PlayerInfo[playerid][pLider] == 14 || PlayerInfo[playerid][pMembro] == 5 || PlayerInfo[playerid][pLider] == 5)
Manda as defines dos
pawn Код:
|