10.01.2015, 00:05
me basei no comentario do cara para responder, porem eu estava errado voce esta a usar strcmp.
Isso alem de ser antigo e o mais antigo metodo de criacao de comandos, recomendo a estudar sobre processadores de comandos.
recomendo este: https://sampforum.blast.hk/showthread.php?tid=460056
porem existem muitos mais.
quanto ao seu problema acredito que resolva.
Isso alem de ser antigo e o mais antigo metodo de criacao de comandos, recomendo a estudar sobre processadores de comandos.
recomendo este: https://sampforum.blast.hk/showthread.php?tid=460056
porem existem muitos mais.
pawn Код:
if(strcmp("/alistar", cmd, true) == 0)
{
if(lider[playerid] == 1 || sublider[playerid] == 1)
{
new plid;
if(sscanf(cmdtext, "s[8]u", cmd, plid))
{
SendClientMessage(playerid, Vermelho, "Digite: /alistar [id]");
return 1;
}
if(IsPlayerConnected(plid))
{
if(PlayerInfo[playerid][_Profissao] == 0)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 0);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Forзa Aerea.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 1)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 1);
format(string, sizeof(string), "%s te alistou para a organizaзгo: swat.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 2)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 2);
format(string, sizeof(string), "%s te alistou para a organizaзгo: PIR.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x666666, string);
}
if(PlayerInfo[playerid][_Profissao] == 3)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 3);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Exercito.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 4)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 4);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Elite Aerea.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 5)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 5);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Comando Vermelho.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 6)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 6);
format(string, sizeof(string), "%s te alistou para a organizaзгo: La Cosa Nostra.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 7)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 7);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Yakuza.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 8)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 8);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Bope.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 9)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 9);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Mar.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x33CCFFAA, string);
}
if(PlayerInfo[playerid][_Profissao] == 10)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 10);
format(string, sizeof(string), "%s te alistou para a organizaзгo: Policia Rodoviaria Federal.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x0069D2FF, string);
}
if(PlayerInfo[playerid][_Profissao] == 11)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 11);
format(string, sizeof(string), "%s te alistou para a organizaзгo: FBI.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0xB0B000AA, string);
}
if(PlayerInfo[playerid][_Profissao] == 12)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 12);
format(string, sizeof(string), "%s te alistou para a organizaзгo: AQ.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x989758FF, string);
}
if(PlayerInfo[playerid][_Profissao] == 13)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 13);
format(string, sizeof(string), "%s te alistou para A TV: Panico Na Bande.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x989758FF, string);
}
if(PlayerInfo[playerid][_Profissao] == 14)
{
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
dini_IntSet(file2, "Profissao", 14);
format(string, sizeof(string), "%s te alistou para o: Gate.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
SendClientMessage(plid, 0x989758FF, string);
}
}
else
{
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado!");
}
}
return 1;
}