#1

Hi.
I have one problem.
I have a command /h(ouse) for putmoney, putdrugs, lock, info...
This is the part of the script:
Код:
     if(sscanf(params, "s[10]i", option,vrednost)) return SendCliientMessage...
     if(strcmp(option,"putmoney") == 0)
     {
      ...
     }
     if(strcmp(option,"info") == 0)
     {
     ...
     }
When i type command putmoney, putdrugs... i have to put /h putmoney [amount] this is OK
And when i type command lock, info... i have to put /h lock [amount]
Now, how can i make so that when i type commands lock, info... i dont have to put the "[amount]".

Thanks.
Reply
#2

Anyone help ?
Reply
#3

HELP ?
Reply
#4

Can anyone help me ? Pleeease
Reply
#5

pawn Код:
if (!sscanf(params, "s[10]i", option, vrednost))
{
    if (!strcmp(option,"putmoney"))
    {
        ...
    }
    else if (!strcmp(option,"putdrugs"))
    {
        ...
    }
    else // send error message, valid options: putmoney, putdrugs
}
else if (!sscanf(params, "s[10]", option))
{
    if (!strcmp(option, "lock"))
    {
        ...
    }
    else if (!strcmp(option, "info"))
    {
        ...
    }
    else // send error message, valid options: lock, info
}
else // send usage..
or
pawn Код:
if (!sscanf(params, "s[10]i", option, vrednost))
{
    if (!strcmp(option, "putmoney"))
    {
        ...
    }
    else if (!strcmp(option, "putdrugs"))
    {
        ...
    }
    else // send error message, valid options: putmoney, putdrugs
}
else
{
    if (strlen(params))
    {
        if (!strcmp(params, "lock"))
        {
            ...
        }
        else if (!strcmp(params, "info"))
        {
            ...
        }
        else // send error message, valid options: lock, info
    }
    else // send usage..
}
Reply
#6

Thanks, that works great
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)