31.07.2014, 14:49
Hello !
I am a low in zcmd.
How to make a subcmd in zcmd? (ex: /tp lspd)
thx all ++
I am a low in zcmd.
How to make a subcmd in zcmd? (ex: /tp lspd)
thx all ++
CMD:tp(playerid, params[])
{
if (isnull(params))
return SendClientMessage(playerid, -1, "Usage: /tp [place]");
if (!strcmp(params, "lspd", true))
{
// Do what you want here
return 1;
}
else if (!strcmp(params, "other", true))
{
// ...
return 1;
}
return 1;
}
CMD:tp(playerid, params[])
{
if (isnull(params))
{
return SendClientMessage(playerid, -1, "Usage: /tp [place]");
}
if(sscanf(params, "lspd", true))
{
// ...
return 1;
}
return 1;
}
CMD:tp(playerid, params[]) { new place[10]; if(sscanf(params,"s[10]", place)) return SendClientMessage(playerid, -1,"Usage: /tp [place"); // ur code here return 1; }
CMD:tp(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /tp [place]");
if(!strcmp(params, "lspd", true))
{
//Player wants to teleport to LSPD
}
else if(!strcmp(params, "los santos", true))
{
//Player wants to teleport to Los Santos
}
else SendClientMessage(playerid, -1, "You have entered an invalid location, try again.");
return 1;
}
Use strcmp (string compare) to compare params with lspd and the others.
pawn Код:
|