18.10.2017, 05:27
Like /call 524-GOV or /call 245-256-242, it ignore the "-" and string
CMD:call(playerid, params[])
{
if(!isnull(params) && !strcmp(params, "524-GOV", true))
{
doSomething();
return 1;
}
//rest of your call cmd below it.
return 1;
}
stock isNumeric(string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
CMD:call(playerid, params[])
{
new number[40];
if(sscanf(params,"s",number)) return SendClientMessage(playerid, -1, "USAGE: /call <number>");
for(new i = 0; i < sizeof(number); i++)
{
if(!strcmp(number, "-") || !strcmp(number, isNumeric(number[i]))
{
strdel(number, i, i+1);
}
}
// Your rest code
return 1;
}