SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 14/12/2018, 09:29 PM   #1
BrunoSayden177
Big Clucker
 
Join Date: Jun 2018
Location: Alfredo Vasconcelos - MG
Posts: 69
Reputation: 0
Question /contratos

Boa Noite galera, eu queria saber como que faz para quando um Hitman/Assassins digitar "/contratos" aparecer todos os players que estão com com contrato. Espero que alguém me ajude

OBS: Eu já criei o comando "/contrato"

@Edit

o comando /contrato que crieu foi esse:

Code:
CMD:contrato(playerid, params[])
{
    if (PlayerInfo[playerid][pOrg] == 1)
    {
        SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Hitmans/Assassins não podem colocar contratos!");
        return 1;
    }
    else
    {
        new id;
        new preco;
        if (sscanf(params, "ud", id, preco))
        return SendClientMessage(playerid, 0xC0C0C0AA, "[INFO] Digite: /contrato [id] [preço]");
        PlayerInfo[id][pCont] = preco;
        return 1;
    }
    return 1;
}
BrunoSayden177 is online now   Reply With Quote
Old 14/12/2018, 09:41 PM   #2
Luiiiz
Huge Clucker
 
Join Date: Nov 2015
Location: Casa
Posts: 231
Reputation: 2
Default Re: /contratos

PHP Code:
CMD:contratos(playerid)
{
    new 
count 0iname[MAX_PLAYER_NAME], string[128];
    if(
Hitman[playerid] == 0)
        return 
SendClientMessage(playerid, -1"Você não é um Hitman/Assassins.");
    for(new 
iMAX_PLAYERSi++)
    {
        if(
Contratado[i] == && IsPlayerConnected(i))
        {
            
GetPlayerName(iinameMAX_PLAYER_NAME);
            
count++;
            
SendClientMessage(playerid, -1"Contratos abertos:");
            
format(stringsizeof(string), "%s[%d]"inamei);
            
SendClientMessage(playerid, -1string);
        }
    }
    if(
count == 0)
        return 
SendClientMessage(playerid, -1"Não há contratados online.");
    return 
1;

Não testei.
Luiiiz is offline   Reply With Quote
Old 14/12/2018, 09:51 PM   #3
BrunoSayden177
Big Clucker
 
Join Date: Jun 2018
Location: Alfredo Vasconcelos - MG
Posts: 69
Reputation: 0
Default Re: /contratos

Quote:
Originally Posted by Luiiiz View Post
PHP Code:
CMD:contratos(playerid)
{
    new 
count 0iname[MAX_PLAYER_NAME], string[128];
    if(
Hitman[playerid] == 0)
        return 
SendClientMessage(playerid, -1"Você não é um Hitman/Assassins.");
    for(new 
iMAX_PLAYERSi++)
    {
        if(
Contratado[i] == && IsPlayerConnected(i))
        {
            
GetPlayerName(iinameMAX_PLAYER_NAME);
            
count++;
            
SendClientMessage(playerid, -1"Contratos abertos:");
            
format(stringsizeof(string), "%s[%d]"inamei);
            
SendClientMessage(playerid, -1string);
        }
    }
    if(
count == 0)
        return 
SendClientMessage(playerid, -1"Não há contratados online.");
    return 
1;

Não testei.
Não funfo
BrunoSayden177 is online now   Reply With Quote
Old 14/12/2018, 10:34 PM   #4
1sbedx
Big Clucker
 
1sbedx's Avatar
 
Join Date: Dec 2015
Posts: 167
Reputation: 23
Default Re: /contratos

PHP Code:
CMD:contratos(playerid)
{
    static
        
name[MAX_PLAYER_NAME],
        
str[53];

    
SendClientMessage(playerid, -1"Contratos:");

    for (new 
0GetPlayerPoolSize(); <= j++)
    {
        if (!
PlayerInfo[i][pCont])
            continue;

        
GetPlayerName(inamesizeof(name));

        
format(strsizeof(str), "Nome: %s - Preço: %i"namePlayerInfo[i][pCont]);
        
SendClientMessage(playerid, -1str);
    }

    if (!
strlen(str))
        
SendClientMessage(playerid, -1"Nenhum contrato encontrado.");

    return 
1;

1sbedx is offline   Reply With Quote
Old 14/12/2018, 10:36 PM   #5
JamesDias
Little Clucker
 
JamesDias's Avatar
 
Join Date: Feb 2016
Posts: 30
Reputation: 4
Default Re: /contratos

Quote:
CMD:contratos(playerid)
{
new cstr[128];
MEGAString[0] = EOS;
if(PlayerInfo[playerid][pOrg] != 1)
return SendClientMessage(playerid, -1, "Você não é um Assassino.");
strcat(MEGAString, "Id/Nome\tValor\n");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pCont] > 0 && IsPlayerConnected(i))
{
format(cstr, 128, "{FFFFFF}%d %s\t{00FF00}%d\n", i, GetName(i), PlayerInfo[i][pCont]);
strcat(MEGAString, cstr);
}
}
ShowPlayerDialog(playerid, 30303, DIALOG_STYLE_TABLIST_HEADERS, "Contratos", MEGAString, "Pegar", "Fechar");
return 1;
}
Se precisar do GetName
Quote:
GetName(playerid)
{
new Name[24];
GetPlayerName(playerid, Name, sizeof Name);
return Name;
}
Não cheguei a testar
__________________
Alguns Mapas
JamesDias is offline   Reply With Quote
Old 14/12/2018, 11:55 PM   #6
BrunoSayden177
Big Clucker
 
Join Date: Jun 2018
Location: Alfredo Vasconcelos - MG
Posts: 69
Reputation: 0
Default Re: /contratos

Quote:
Originally Posted by 1sbedx View Post
PHP Code:
CMD:contratos(playerid)
{
    static
        
name[MAX_PLAYER_NAME],
        
str[53];

    
SendClientMessage(playerid, -1"Contratos:");

    for (new 
0GetPlayerPoolSize(); <= j++)
    {
        if (!
PlayerInfo[i][pCont])
            continue;

        
GetPlayerName(inamesizeof(name));

        
format(strsizeof(str), "Nome: %s - Preço: %i"namePlayerInfo[i][pCont]);
        
SendClientMessage(playerid, -1str);
    }

    if (!
strlen(str))
        
SendClientMessage(playerid, -1"Nenhum contrato encontrado.");

    return 
1;

Vlw men, +rep pra vc
BrunoSayden177 is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] comando /admins e /contratos MateGPlay Português/Portuguese 22 25/10/2018 11:59 PM
[Ajuda] /Contratos Hunterx157 Português/Portuguese 8 16/05/2018 05:03 PM
[Ajuda] Mensagem dos contratos (assasinos) FPB_Lipos Português/Portuguese 12 09/01/2013 01:44 AM
[Ajuda]Ver Contratos. Leo_Lost Português/Portuguese 4 28/01/2012 03:19 PM
[AJUDA]Contratos BrunoBSF Português/Portuguese 21 18/08/2011 11:35 PM


All times are GMT. The time now is 07:59 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.