PHP код:
if(strcmp(cmd, "/try", true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx,result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx]; idx++;
}
result[idx - offset] = EOS;
new chance = random(4);
if(chance < 2)
{
if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "Используйте: /try [действие]");
format(string, sizeof(string), "%s %s {1CEF00}| Удачно",Name(playerid), result);
ProxDetector(5.0, playerid, string, 0xDD90FFFF, 0xDD90FFFF, 0xDD90FFFF, 0xDD90FFFF, 0xDD90FFFF);
format(string,sizeof(string), "%s {1CEF00}| Удачно", result);
SetPlayerChatBubble(playerid,string,0xDD90FFFF,30.0,10000);
}
else
{
if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "Используйте: /try [действие]");
format(string, sizeof(string), "%s %s {FF0000}| Неудачно",Name(playerid), result);
ProxDetector(5.0, playerid, string, 0xDD90FFFF, 0xDD90FFFF, 0xDD90FFFF, 0xDD90FFFF, 0xDD90FFFF);
format(string,sizeof(string), "%s {FF0000}| Неудачно", result);
SetPlayerChatBubble(playerid,string,0xDD90FFFF,30.0,10000);
}
return true;
}