Fox228228
Новичок
Всем привет, как сделать команду /todo через dc_cmd, CMD:todo(playerid, params[])
PHP:
if(strcmp(cmd, "/todo", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Используйте: /todo [речь в чат*действие]");
return 1;
}
if(strfind(result,"*",true,0) == -1)
{
SendClientMessage(playerid, COLOR_GRAD2, "Вы не поставили символ разделения '*' ))");
return 1;
}
new one[65];
new two[65];
new pos = strfind(result, "*" ,true);
strmid(one, result, 0, pos);
strmid(two, result, pos+1, 128);
GetInitials(playerid);
{ format(string, sizeof(string), "{C2A2DA}- {FFFFFF}%s {C2A2DA}- сказал %s, {C2A2DA}%s", one, GetPlayerNameEx(playerid), two); }
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerChatBubble(playerid, result, COLOR_PURPLE, 20.0, 10000);
printf("%s", string);
}
return 1;
}
