How to make command, with one word argument?
#1

How to make command, with one word argument?
for example:
if /test test1 do something
if /test test2 do something
Reply
#2

body command:

if(!strcmp(argument, "test1"))
{

}
else if(!strcmp(argument, "test2"))
{

}
Reply
#3

pawn Код:
CMD:test(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /test <test1/test2>");
    if(!strcmp(params, "test1", true))
    {
        // Do something;
    }
    else if(!strcmp(params, "test2", true))
    {
        // Do something;
    }
    else SendClientMessage(playerid, -1, "Usage: /test <test1/test2>");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)