08.02.2011, 23:36
Tenta esse:
pawn Код:
if(strcmp(cmd, "/tentar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб Logado !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
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: /tentar [aзгo]");
return 1;
}
new randa = random(2)+1;
if(PlayerInfo[playerid][pMaskuse] == 1)
{
if(randa == 1) format(string, sizeof(string), "*** Estranho tenta %s e foi um Sucesso", result);
else format(string, sizeof(string), "*** Estranho tenta %s mais Falhou", result);
}
else
{
if(randa == 1) format(string, sizeof(string), "*** %s tenta %s e foi um Sucesso", sendername, result);
else format(string, sizeof(string), "*** %s tenta %s, mais Falhou", sendername, result);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
}
return 1;
}