17.11.2009, 17:09
Bueno no estoy seguro porque no puedo probar el codigo pero creo que asi se arregla:
pawn Код:
if(strcmp(cmd, "/intentar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " No te has Logeado !");
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, "USA: /intentar [accion]");
return 1;
}
new which_message = random(2);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(which_message == 0)
{
format(string, sizeof(string), "*%s intenta %s y lo logra", name, result);
ProxDetector(30.0,playerid,string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "*Extraсo intenta %s y lo logra", name, result); ProxDetector(30.0,playerid,string,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
return 1;
}
else if(which_message == 1)
{
format(string, sizeof(string), "*%s intenta %s y falla", name, result);
ProxDetector(30.0,playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "*Extraсo intenta %s y falla", name, result); ProxDetector(30.0,playerid,string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
return 1;
}
}
return 1;
}
return 0;
}