SA-MP Forums Archive
[Ajuda] Comando /Su que estou desenvolvendo [...] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando /Su que estou desenvolvendo [...] (/showthread.php?tid=514348)



Comando /Su que estou desenvolvendo [...] - Duun - 21.05.2014

pawn Код:
#include <a_samp>
#include <sscanf>
#include <zcmd>

new Wanted_Level[MAX_PLAYERS];

command(su, playerid, params[])
{
    new id, crime, Name[120];

    if(sscanf(params, "uu", id, crime))
    {
        SendClientMessage(playerid, 0xFFFFFFAA , "Use: /Su ID IDCrime" );
    }

    if (crime < 0 || crime > 20)
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "Nгo existe crime com esse ID");
    }
   
    if(crime == 1  )    { Name = "Resistкncia a Prisгo" ;       }
    if(crime == 2  )    { Name = "Trafico de Drogas" ;          }
    if(crime == 3  )    { Name = "Trafico de Armas" ;           }
    if(crime == 4  )    { Name = "Tentativa de Homicнdeo" ;     }
    if(crime == 5  )    { Name = "Desacato a Ordem Policial"}
    if(crime == 6  )    { Name = "Porte Ilegal de Armas" ;      }
    if(crime == 7  )    { Name = "Desacato" ;                   }
    if(crime == 8  )    { Name = "Fuga a Abordagem Policial"}
    if(crime == 9  )    { Name = "Vandalismo" ;                 }
    if(crime == 10 )    { Name = "Roubo" ;                      }
    if(crime == 11 )    { Name = "Roubo Seguido de Morte" ;     }
    if(crime == 12 )    { Name = "Agressгo" ;                   }
    if(crime == 13 )    { Name = "Suborno" ;                    }
    if(crime == 14 )    { Name = "Invasгo a Local Proibнdo" ;   }
    if(crime == 15 )    { Name = "Assalto" ;                    }
    if(crime == 16 )    { Name = "Assalto Seguido de Morte" ;   }
    if(crime == 17 )    { Name = "Sequestro" ;                  }
    if(crime == 18 )    { Name = "Sequestro Seguido de Morte" ; }
    if(crime == 19 )    { Name = "Atentado Violento ao Pudф"}
    if(crime == 20 )    { Name = "Direзгo Ofenciva" ;           }
   
    else
    {
        new Str[125];
        new NCop [25];

        GetPlayerName(playerid,  NCop, 25);
        format(Str, sizeof(Str), "Vocк cometeu um crime: %s. Acusador: %s", Name, NCop );
        SendClientMessage(id, 0xFFFFFFAA, Str );
       
        Wanted_Level[id] ++;
        SetPlayerWantedLevel(id, Wanted_Level[id] );
    }
    return 1;
}
Galera queria saber, esse comando vai funcionar ? Tф pelo not nгo tenho como testar !
Pela lуgica creio que irб funcionar, mais se tiver algo errado alguйm comenta ai


Re: Comando /Su que estou desenvolvendo [...] - MultiKill - 21.05.2014

Use:
pawn Код:
if(IsPlayerConnected(id)) // para verificar se o jogador selecionado estб online