07.04.2012, 23:20
Encontrei um bug no gm aqui, o player lider digita /convidar para um player civil (sem nenhum profissao nem nada) e diz que o player n pode entrar na profissao.. sempre da isso, alguem sabe onde estб o erro? vlw
pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /convidar [playerid/Parte-do-Nick]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1 && PlayerInfo[para1][pMember] == 0)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Polнcia Militar"; }
else if(PlayerInfo[playerid][pLeader] == 2) { ftext = "Polнcia Federal"; }
else if(PlayerInfo[playerid][pLeader] == 3) { ftext = "Forзas Armadas"; }
//else if(PlayerInfo[playerid][pLeader] == 4) { ftext = "Emergкncias."; }
else if(PlayerInfo[playerid][pLeader] == 5) { ftext = "Front Yard Ballas"; }
else if(PlayerInfo[playerid][pLeader] == 6) { ftext = "Grove Street"; }
else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "Polнtico"; }
else if(PlayerInfo[playerid][pLeader] == 8) { ftext = "Hitman"; }
else if(PlayerInfo[playerid][pLeader] == 9) { ftext = "Repуrter"; }
else if(PlayerInfo[playerid][pLeader] == 10) { ftext = "Lowrider"; }
else if(PlayerInfo[playerid][pLeader] == 11) { ftext = "San Fierro Riffa"; }
else if(PlayerInfo[playerid][pLeader] == 12) { ftext = "Los Santos Vagos"; }
else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "Asphalt King's"; }
else if(PlayerInfo[playerid][pLeader] == 14) { ftext = "Policia Rodoviaria"; }
else if(PlayerInfo[playerid][pLeader] == 15) { ftext = "Varrio Los Aztecas"; }
else if(PlayerInfo[playerid][pLeader] == 16) { ftext = "Triads"; }
else if(PlayerInfo[playerid][pLeader] == 17) { ftext = "Mafia Yakuza"; }
else if(PlayerInfo[playerid][pLeader] == 18) { ftext = "Drifters"; }
else if(PlayerInfo[playerid][pLeader] == 19) { ftext = "Comando Vermelho"; }
else if(PlayerInfo[playerid][pLeader] == 20) { ftext = "Pcc"; }
else if(PlayerInfo[playerid][pLeader] == 21) { ftext = "BOPE"; }
else if(PlayerInfo[playerid][pLeader] == 22) { ftext = "Al-Qaeda"; }
else if(PlayerInfo[playerid][pLeader] == 23) { ftext = "Policia Civil"; }
else if(PlayerInfo[playerid][pLeader] == 24) { ftext = "Bombeiros"; }
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("|ADMIN|: %s convidou %s para entrar no grupo dos: '%s'", sendername, giveplayer, ftext);
format(string, sizeof(string), "Vocк recebeu um convite para entrar na profissгo '%s' (digite /aceitar convite) para aceitar.", ftext, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк convidou %s para sua profissгo '%s'.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
Invite[para1] = 1;
InviteOffer[para1] = playerid;
InviteJob[para1] = PlayerInfo[playerid][pLeader];
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O jogador nгo pode se tornar essa profissгo.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado a ultilizar este comando !");
}
}
return 1;
}