[Ajuda] Comando em ZCMD
#1

Como tornar possнvel?

PHP код:
CMD:empresa(playeridparams[])
{
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Uso correto: /Empresa [ Comando ]");
    if(!
strcmp(params"contratar"true))
    {
        if(
sscanf(params"d"ID)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Uso correto: /Empresa Contratar [ ID ]"); /*- Essa Parte Funciona -*/
        
if(!IsPlayerConnected(ID)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Ninguйm online com esse ID!");    /*- Apartir daqui nгo -*/
    
}
    return 
1;

Reply
#2

PHP код:
#define SCM SendClientMessage
CMD:empresa(playeridparams[])
{
    new 
command[15], id;
    if(
sscanf(params"su"commandid)) return SCM(playerid,COLOR_ERRO"| ERRO | Digite: /Empresa [comando] [id player]");

    if(!
strcmp(command"contratar"true))
    {
        if(!
IsPlayerConnected(id)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Ninguйm online com esse ID!");    /*- Apartir daqui nгo -*/
    
}
    return 
1;

Reply
#3

Cada comando teria uma funзгo diferente, nem todos usariam 2 parвmetros. Seria possнvel?

Por exemplo: /Empresa Info e /Empresa Contratar [ ID ].

Agradeзo a atenзгo.
Reply
#4

Quote:
Originally Posted by NWDMadara
Посмотреть сообщение
Cada comando teria uma funзгo diferente, nem todos usariam 2 parвmetros. Seria possнvel?

Por exemplo: /Empresa Info e /Empresa Contratar [ ID ].

Agradeзo a atenзгo.
PHP код:
#define SCM SendClientMessage
CMD:empresa(playeridparams[])
{
    new 
command[15];
    if(
sscanf(params"s"command)) return SCM(playeridCOLOR_ERRO"| ERRO | Digite: /Empresa [Comando]");
    
    if(!
strcmp(command"contratar"true))
    {
        new 
id;
        if(
sscanf(params"u"id)) return SCM(playerid,COLOR_ERRO"| ERRO | Digite: /Empresa [id player]");
        if(!
IsPlayerConnected(id)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Ninguйm online com esse ID!");    /*- Apartir daqui nгo -*/
    
}
    else if(!
strcmp(command"info"true))
    {
        
//Seu Codigo Aq
    
}
    return 
1;

Reply
#5

Ao digitar '/Empresa Contratar', recebo a seguinte mensagem: "Ninguйm online com esse ID!".
Reply
#6

PHP код:
CMD:empresa(playeridparams[])
{
    static
        
id,
        
type[16],
        
string[32];

    if (
sscanf(params"is[16]S()[32]"idtypestring))
        return 
SendClientMessage(playerid, -1"/empresa [id da empresa] [opзгo]");

    if (!
strcmp(type"contratar"true))
    {
        static
            
pid;

        if (
sscanf(string"u"pid))
            return 
SendClientMessage(playerid, -1"/empresa [id da empresa] [contratar] [player id]");

        if (!
IsPlayerConnected(pid))
            return 
SendClientMessage(playerid, -1"O jogador especificado nгo estб conectado.");

        
printf("id da empresa %i player id %i"idpid);
    }
    return 
1;

Reply
#7

Quote:
Originally Posted by 1sbedx
Посмотреть сообщение
PHP код:
CMD:empresa(playeridparams[])
{
    static
        
id,
        
type[16],
        
string[32];
    if (
sscanf(params"is[16]S()[32]"idtypestring))
        return 
SendClientMessage(playerid, -1"/empresa [id da empresa] [opзгo]");
    if (!
strcmp(type"contratar"true))
    {
        static
            
pid;
        if (
sscanf(string"u"pid))
            return 
SendClientMessage(playerid, -1"/empresa [id da empresa] [contratar] [player id]");
        if (!
IsPlayerConnected(pid))
            return 
SendClientMessage(playerid, -1"O jogador especificado nгo estб conectado.");
        
printf("id da empresa %i player id %i"idpid);
    }
    return 
1;

Funcionou, muito obrigado (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)