SA-MP Forums Archive
*** Terrible Title Removed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: *** Terrible Title Removed (/showthread.php?tid=387264)



*** Terrible Title Removed - Majava - 23.10.2012

> 5 means 6-∞ ?
and < 1 means 0 or lower?
>= 5 means 5?

Then i need help with one cmd.
like -> /buy 1-5
1 = something
2 = something...


Re: I wanna know few things. - Eminem 2ka9 - 23.10.2012

>5 means 5 or More
<1 means 1 Or Lower
>= 5


Re: I wanna know few things. - Anthony © - 23.10.2012

>= 5 means 'greater than or equal to 5'


Re: I wanna know few things. - Majava - 23.10.2012

How i can make command with 2 different effect like /hi 1 /hi 2 ? I use sscanf and zcmd CMD:hi(playerid,params[])


Re: I wanna know few things. - Anthony © - 23.10.2012

Quote:

CMD:hi(playerid, params[])
{
new numb;
{
if(sscanf(params, "i", numb)) return SendClientMessage(playerid, 0x8C8573C8, "/hi [number]");
{
if(numb == 1)
{
SendClientMessage(playerid, COLOR_RED, "/hi 1");
}
if(numb == 2)
{
SendClientMessage(playerid, COLOR_RED, "/hi 2");
}
}
}
return 1;
}

That?


Re: I wanna know few things. - ViniBorn - 23.10.2012

Quote:
Originally Posted by Anthony ©
Посмотреть сообщение
CMD:hi(playerid, params[])
{
new numb;
{
if(sscanf(params, "i", numb)) return SendClientMessage(playerid, 0x8C8573C8, "/hi [number]");
{
if(numb == 1)
{
SendClientMessage(playerid, COLOR_RED, "/hi 1");
}
if(numb == 2)
{
SendClientMessage(playerid, COLOR_RED, "/hi 2");
}
}
}
return 1;
}
This wrong
pawn Код:
CMD:hi(playerid,params[])
{
    new Number;
    if(sscanf(params,"d",Number)) return SendClientMessage(playerid, -1 "/hi [number]");

    switch(Number)
    {
        case 0: SendClientMessage(playerid, -1 "Number 1");
        case 1: SendClientMessage(playerid, -1 "Number 2");
    }
    return true;
}



Re : I wanna know few things. - lelemaster - 23.10.2012

No Anthony. Your codes have a good start, but need some modification.

Код:
CMD:hi(playerid, params[])
{
    new numb;
    if(sscanf(params, "i", numb)) return SendClientMessage(playerid, 0x8C8573C8, "/hi [number]");
    {
        if(numb == 1)
        {
            SendClientMessage(playerid, COLOR_RED, "/hi 1");
        }
        if(numb == 2)
        {
            SendClientMessage(playerid, COLOR_RED, "/hi 2");
        }
    }
    return 1;
}
You can also make it with a switch.

https://sampwiki.blast.hk/wiki/Control_Structures#switch_2

Код:
CMD:hi(playerid, params[])
{
    new numb;
    if(sscanf(params, "i", numb)) return SendClientMessage(playerid, 0x8C8573C8, "/hi [number]");
    {
        switch(numb)
        {
            case 1:
            {
                SendClientMessage(playerid, COLOR_RED, "/hi 1");
            }
            case 2:
            {
                SendClientMessage(playerid, COLOR_RED, "/hi 2");
            }
            default:
            {
                //the message for the hi 1 or 2
            }
        }    
    }
    return 1;
}
Edit: Damn it, Vini replied before


Re: Re : I wanna know few things. - Majava - 23.10.2012

How i make it with words like yes / no
new word;
if(word == yes)
{ ...