07.09.2011, 11:55
eu tenho este comando em strcmp, e gostaria te-lo convertido para ZCMD.
Poderiam-me ajudar ?
Poderiam-me ajudar ?
pawn Код:
if(strcmp(cmd, "/attempt", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
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, "[USAGE:] /attempt [action]");
return 1;
}
new succeed = 1 + random(2);
if(succeed == 1)
{
format(string, sizeof(string), "[Tentar:] %s tenta %s e consegue.", GetPlayerNameEx(playerid), result);
ProxDetector(10.0, playerid, string, COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE);
}
else if(succeed == 2)
{
format(string, sizeof(string), "[Tentar:] %s tenta %s e falha.", GetPlayerNameEx(playerid), result);
ProxDetector(10.0, playerid, string, COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE,COLOR_LIGHTBLUE);
}
}
return 1;
}