[ajuda] vender materiais
#1

ola , fiz um sistema de vender materiais , e coloquei pra vender pro ID do player e a quantidade , so que quanto digita o comando , aparece a mensagem
pawn Код:
Numero de materiais minimos 100 e maximo 99999
o codigo que eu fiz foi
pawn Код:
if(strcmp(cmd, "/vendermateriais", true) == 0)
    {
        new ammount = strval(tmp);
        new playa;
        new price;
        new org = GetPlayerOrg(playerid);
        if(org != 12 && org != 13)
        {
            SendClientMessage(playerid,COLOR_GREY," Vocк nгo й um mafioso!");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        ammount = strval(tmp);
        if(ammount < 100 || ammount > 99999) { SendClientMessage(playerid, COLOR_GREY, "Numero de materiais minimos 100 e maximo 99999"); return 1; }
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD1, "USE: /vendermateriais [id] [quantidade]");
            return 1;
        }
        if(playa != INVALID_PLAYER_ID)
        {
        if (ProxDetectorS(8.0, playerid, playa))
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* Vocк ofereceu %s a comprar %d materiais por R$%d", giveplayer, ammount, price);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string,sizeof(string),"O mafioso %s quer te vender %d materiais por R$%d",sendername, ammount, price);
        ShowPlayerDialog(playerid,3737,DIALOG_STYLE_MSGBOX,"Materiais",string,"Aceitar","Recusar");
        }
        return 1;
    }


me ajudem pf obrigado
Reply
#2

me ajudem pf
Reply
#3

tenta

pawn Код:
if(strcmp(cmd, "/vendermateriais", true) == 0)
    {
        new ammount = strval(tmp);
        new playa;
        new price;
        new org = GetPlayerOrg(playerid);
        if(org != 12 && org != 13)
        {
            SendClientMessage(playerid,COLOR_GREY," Vocк nгo й um mafioso!");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        ammount = strval(tmp);
        if(ammount < 0 || ammount > 99999) { SendClientMessage(playerid, COLOR_GREY, "Numero de materiais minimos 0 e maximo 99999"); return 1; }
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GRAD1, "USE: /vendermateriais [id] [quantidade]");
            return 1;
        }
        if(playa != INVALID_PLAYER_ID)
        {
        if (ProxDetectorS(8.0, playerid, playa))
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* Vocк ofereceu %s a comprar %d materiais por R$%d", giveplayer, ammount, price);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string,sizeof(string),"O mafioso %s quer te vender %d materiais por R$%d",sendername, ammount, price);
        ShowPlayerDialog(playerid,3737,DIALOG_STYLE_MSGBOX,"Materiais",string,"Aceitar","Recusar");
        }
        return 1;
    }
Reply
#4

deu certo ! vlw , mas o problema agora e que nao da pra por a quantidade , tipo oque eu quero eh que quando venda digite por exemplo :

/vendermateriais id quantidade

Mas so funciona desse jeito
/vendermateriais id

podem me ajudar?
Reply
#5

helppppppp
Reply
#6

eu nao mecho com strtok , mais olha o double tem apenas 13 minutos que vocк posto veja as regras : https://sampforum.blast.hk/showthread.php?tid=267034
Reply
#7

me ajudem po
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)