15.05.2012, 16:17
Bom estou adicionando para sub-lider poder convidar tentei muitas formas, mas sem sucesso se auguem poder ajudar
pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк precisa logar para usar este comando, use /logar [senha]!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidar [playerid/Parte do Nome]");
return 1;
}
new para1;
new ftext[20];
new org;
para1 = ReturnUser(tmp);
if(PlayerInfo[para1][pMember] != 0 || PlayerInfo[para1][pLeader] != 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Desculpe-me mais este player jб participa de uma oganizaзгo.");
return 1;
}
if(PuxarOrganizacao(playerid) >= 1)
{
if(IsPlayerConnected(para1))
{
if(PlayerInfo[para1][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Sу pode convidar quem й level 2 ou acima de 2!!"); return 1;
}
if(PlayerInfo[playerid][pRank] == 6 || PlayerInfo[playerid][pRank] == 444 || PlayerInfo[playerid][pRank] == 555)
{
if(para1 != INVALID_PLAYER_ID)
{
if (PlayerInfo[para1][pMember] == 0)
{
org = PuxarOrganizacao(playerid);
if(ConviteInfoOrg(pNome(para1), org, 1)) { } else { SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sua organizaзгo estб cheia limpe uma vaga!"); return 1;}
if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar"; ChosenSkin[para1] = 280; SetPlayerSkin(para1, 280);}
else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "ROTAM"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286);}
else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 3; gTeam[para1] = 3; ftext = "Exercito"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287);}
else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Medicos"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70);}
else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "GI"; ChosenSkin[para1] = 113; SetPlayerSkin(para1, 113);}
else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Asfarc"; ChosenSkin[para1] = 123; SetPlayerSkin(para1, 123);}
else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Prefeitura"; ChosenSkin[para1] = 163; SetPlayerSkin(para1, 163);}
else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 10; ftext = "Assasinos"; ChosenSkin[para1] = 127; SetPlayerSkin(para1, 127);}
else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Reporteres"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148);}
else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxistas"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255);}
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Instrutores"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59);}
else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Groove"; ChosenSkin[para1] = 270; SetPlayerSkin(para1, 270);}
else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 13; gTeam[para1] = 13; ftext = "Ballas"; ChosenSkin[para1] = 104; SetPlayerSkin(para1, 104);}
else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 14; gTeam[para1] = 14; ftext = "Vagos"; ChosenSkin[para1] = 110; SetPlayerSkin(para1, 110);}
else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 15; ftext = "Aztecas"; ChosenSkin[para1] = 115; SetPlayerSkin(para1, 115);}
else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 16; gTeam[para1] = 2; ftext = "Policia Rodoviaria"; ChosenSkin[para1] = 186; SetPlayerSkin(para1, 186);}
else if(PlayerInfo[playerid][pLeader] == 17) { PlayerInfo[para1][pTeam] = 17; gTeam[para1] = 17; ftext = "Comando Vermelho"; ChosenSkin[para1] = 170; SetPlayerSkin(para1, 170);}
else if(PlayerInfo[playerid][pLeader] == 18) { PlayerInfo[para1][pTeam] = 18; gTeam[para1] = 18; ftext = "PCC"; ChosenSkin[para1] = 47; SetPlayerSkin(para1, 47);}
else if(PlayerInfo[playerid][pLeader] == 19) { PlayerInfo[para1][pTeam] = 19; gTeam[para1] = 19; ftext = "Mafia Russa"; ChosenSkin[para1] = 144; SetPlayerSkin(para1, 144);}
else if(PlayerInfo[playerid][pLeader] == 20) { PlayerInfo[para1][pTeam] = 20; gTeam[para1] = 20; ftext = "Mafia Italiana"; ChosenSkin[para1] = 57; SetPlayerSkin(para1, 57);}
else if(PlayerInfo[playerid][pLeader] == 21) { PlayerInfo[para1][pTeam] = 21; gTeam[para1] = 2; ftext = "Policia Federal"; ChosenSkin[para1] = 288; SetPlayerSkin(para1, 288);}
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
PlayerInfo[para1][pRank] = 1;
printf("* Server: %s tem convidado o %s para entra na(o) %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), " Vocк entrou para %s, vocк foi convidado pelo lider %s", ftext, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк convidou %s para entrar para %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPlayerInterior(para1,0);
PlayerInfo[playerid][pCarLic] = 1;
PlayerInfo[playerid][pMotoLic] = 1;
PlayerInfo[playerid][pFlyLic] = 1;
PlayerInfo[playerid][pBoatLic] = 1;
PlayerInfo[playerid][pFishLic] = 1;
PlayerInfo[playerid][pGunLic] = 1;
new rand = random(sizeof(gInviteSpawns));
SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
TogglePlayerControllable(para1, 0);
SelectChar[para1] = 255;
SelectCharID[para1] = PlayerInfo[para1][pMember];
SelectCharPlace[para1] = 1;
PlayerInfo[para1][pModel] = ChosenSkin[para1];
PlayerInfo[para1][pChar] = ChosenSkin[para1];
ShowPlayerDialog(para1, 41, DIALOG_STYLE_MSGBOX, "Convite:", "{ADFF2F}Vocк foi convidado para participar de uma organizaзгo\n{9ACD32}Escolha {FF0000}Prуximo {9ACD32}para trocar a skin que deseja\n{FF0000}Pronto {9ACD32}Para escolhe-la a skin desejada.", "Pronto", "Prуximo");
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Esse jogador й procurado/ Й de uma organizaзгo diferente/ ou membro de uma familia.");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem cargo o suficiente para poder convidar!");
return 1;
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo estб autorizado para usar este comando( Somente Lideres/Sub-Lideres )!");
}
}
return 1;
}