26.02.2010, 14:07
Hello. I would do the command / command [text / text] [player id / all], but I do not know how. In addition, I would like to do in dcmd, so surely with sscanf. Please help
dcmd_caps(playerid, params[])
{
new mode[3], id, all[3];
if (sscanf(params, "sd", mode, id))
{
if (sscanf(params, "ss", mode, all))
{
return SendClientMessage(playerid, 0xC0C0C0FF, "USE: /caps [on/off] [playerid/all]");
}
else if (!strcmp(mode, "off", true))
{
// Turn off for all
}
else if (!strcmp(mode, "on", true))
{
// Turn on for all
}
}
else if (!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xC0C0C0FF, "Player not connected");
else if (!strcmp(mode, "off", true))
{
// Turn off for id
}
else if (!strcmp(mode, "on", true))
{
// Turn on for id
}
else return SendClientMessage(playerid, 0xC0C0C0FF, "USE: /caps [on/off] [playerid/all]");
return 1;
}
Originally Posted by MrLeNy
and that was /caps [player id/all] [on/off] how do I modify it?
|