23.10.2012, 21:49
No Anthony. Your codes have a good start, but need some modification.
You can also make it with a switch.
https://sampwiki.blast.hk/wiki/Control_Structures#switch_2
Edit: Damn it, Vini replied before
Код:
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;
}
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;
}

