08.02.2011, 23:31
Boas.
Tenho o seguinte problema, estou a fazer um gamemode RP, e nгo consigo fazer o comando /tentar, eu escrevo o comando no jogo e nгo faz nada, ele compila sem nenhum erro/warning.
Aqui fica o cуdigo.
Alguйm consegue ver se tem algum problema para nгo dar?
Tenho o seguinte problema, estou a fazer um gamemode RP, e nгo consigo fazer o comando /tentar, eu escrevo o comando no jogo e nгo faz nada, ele compila sem nenhum erro/warning.
Aqui fica o cуdigo.
Код:
if(strcmp(cmd, "/tentar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Ainda nгo fizeste login!");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "hm, hm, hm.... hm.... hm....");
return 1;
}
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, "Dica: /tentar [acзгo]");
return 1;
}
new randa = random(2)+1;
if(PlayerInfo[playerid][pAdminDuty] == 0)
{
if(randa == 1) format(string, sizeof(string), "%s tenta %s e consegue.", sendername, result);
else format(string, sizeof(string), "%s tenta %s e falha.", sendername, result);
}
}
return 1;
}


