08.10.2010, 15:59
galera to tentando des que eu acordei e nao consigo o cmd de convida pra sub ele
tipo o player convida da igual a nada
tipo o player convida da igual a nada
pawn Код:
if(strcmp(cmd, "/convidarsub", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidarsub [ id ]");
return 1;
}
new para1;
new ftext[20];
new org;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLider] > 0 || PlayerInfo[playerid][pMembro] == 5)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Desculpe-me mais estes players jб participam de Org/Gang.");
return 1;
}
if(PlayerInfo[playerid][pCargo] > 5)
{
if(IsPlayerConnected(para1))
{
if(PlayerInfo[para1][pLevel] < 2) { SendClientMessage(playerid, COLOR_GREY, "So pode convidar quem й nivel 2 ou acima de 2!!!"); return 1;
}
if(para1 != INVALID_PLAYER_ID)
{
if (PlayerInfo[para1][pMembro] == 0 && PlayerInfo[para1][pFMember] == 255)
{
if(PlayerInfo[playerid][pLider] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Policia Militar"; ChosenSkin[para1] = 280; SetPlayerSkin(para1, 280); }
else if(PlayerInfo[playerid][pLider] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "B.O.P.E"; ChosenSkin[para1] = 285; SetPlayerSkin(para1, 285); }
else if(PlayerInfo[playerid][pLider] == 3) { PlayerInfo[para1][pTeam] = 3; gTeam[para1] = 3; ftext = "Exйrcito"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
else if(PlayerInfo[playerid][pLider] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "Mйdicos"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
else if(PlayerInfo[playerid][pLider] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Varrios Los Aztecas"; ChosenSkin[para1] = 115; SetPlayerSkin(para1, 115); }
else if(PlayerInfo[playerid][pLider] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Taliban"; ChosenSkin[para1] = 121; SetPlayerSkin(para1, 121); }
else if(PlayerInfo[playerid][pLider] == 7) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Prefeitura"; ChosenSkin[para1] = 147; SetPlayerSkin(para1, 147); }
else if(PlayerInfo[playerid][pLider] == 8) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Hitman Agency"; ChosenSkin[para1] = 127; SetPlayerSkin(para1, 127); }
else if(PlayerInfo[playerid][pLider] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Reporteres"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
else if(PlayerInfo[playerid][pLider] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxistas"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
else if(PlayerInfo[playerid][pLider] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "PCC"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
else if(PlayerInfo[playerid][pLider] == 13) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Mecanicos"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
else if(PlayerInfo[playerid][pLider] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Instrutores"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }
else if(PlayerInfo[playerid][pLider] == 15) { PlayerInfo[para1][pTeam] = 15; gTeam[para1] = 12; ftext = "Groove Street"; ChosenSkin[para1] = 105; SetPlayerSkin(para1, 105); }
else if(PlayerInfo[playerid][pLider] == 16) { PlayerInfo[para1][pTeam] = 16; gTeam[para1] = 12; ftext = "AlQaeda"; ChosenSkin[para1] = 30; SetPlayerSkin(para1, 30); }
else if(PlayerInfo[playerid][pLider] == 17) { PlayerInfo[para1][pTeam] = 17; gTeam[para1] = 2; ftext = "Policia Civil"; ChosenSkin[para1] = 163; SetPlayerSkin(para1, 163); }
else if(PlayerInfo[playerid][pLider] == 18) { PlayerInfo[para1][pTeam] = 18; gTeam[para1] = 12; ftext = "Ballas"; ChosenSkin[para1] = 104; SetPlayerSkin(para1, 104); }
else if(PlayerInfo[playerid][pLider] == 19) { PlayerInfo[para1][pTeam] = 19; gTeam[para1] = 12; ftext = "Vagos"; ChosenSkin[para1] = 109; SetPlayerSkin(para1, 109); }
else if(PlayerInfo[playerid][pLider] == 20) { PlayerInfo[para1][pTeam] = 20; gTeam[para1] = 20; ftext = "Mafia Yakuza"; ChosenSkin[para1] = 21; SetPlayerSkin(para1, 21); }
else if(PlayerInfo[playerid][pLider] == 21) { PlayerInfo[para1][pTeam] = 21; gTeam[para1] = 21; ftext = "Sons Of Anarchy"; ChosenSkin[para1] = 21; SetPlayerSkin(para1, 21); }
else if(PlayerInfo[playerid][pLider] == 22) { PlayerInfo[para1][pTeam] = 22; gTeam[para1] = 22; ftext = "Mбfia Cosa Nostra"; ChosenSkin[para1] = 117; SetPlayerSkin(para1, 117); }
else if(PlayerInfo[playerid][pLider] == 23) { PlayerInfo[para1][pTeam] = 23; gTeam[para1] = 23; ftext = "Comando Vermelho"; ChosenSkin[para1] = 24; SetPlayerSkin(para1, 24); }
else if(PlayerInfo[playerid][pLider] == 24) { PlayerInfo[para1][pTeam] = 24; gTeam[para1] = 24; ftext = "Drifters"; ChosenSkin[para1] = 28; SetPlayerSkin(para1, 28); }
else if(PlayerInfo[playerid][pLider] == 25) { PlayerInfo[para1][pTeam] = 25; gTeam[para1] = 25; ftext = "Policia Federal"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
else if(PlayerInfo[playerid][pLider] == 26) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "ADA"; ChosenSkin[para1] = 180; SetPlayerSkin(para1, 180); }
else if(PlayerInfo[playerid][pLider] == 27) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "AsFarc"; ChosenSkin[para1] = 250; SetPlayerSkin(para1, 250); }
else if(PlayerInfo[playerid][pLider] == 28) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "TCP"; ChosenSkin[para1] = 182; SetPlayerSkin(para1, 182); }
else if(PlayerInfo[playerid][pLider] == 29) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 12; ftext = "ROTA"; ChosenSkin[para1] = 266; SetPlayerSkin(para1, 266); }
else if(PlayerInfo[playerid][pLider] == 31) { PlayerInfo[para1][pTeam] = 23; gTeam[para1] = 23; ftext = "Marinha"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71); }
else if(PlayerInfo[playerid][pLider] == 32) { PlayerInfo[para1][pTeam] = 24; gTeam[para1] = 24; ftext = "CIO"; ChosenSkin[para1] = 72; SetPlayerSkin(para1, 72); }
else if(PlayerInfo[playerid][pLider] == 33) { PlayerInfo[para1][pTeam] = 25; gTeam[para1] = 25; ftext = "Mafia Corleone"; ChosenSkin[para1] = 223; SetPlayerSkin(para1, 223); }
else if(PlayerInfo[playerid][pLider] == 34) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Mafia Traids"; ChosenSkin[para1] = 170; SetPlayerSkin(para1, 170); }
else if(PlayerInfo[playerid][pLider] == 35) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Midnight Club "; ChosenSkin[para1] = 80; SetPlayerSkin(para1, 80); }
else if(PlayerInfo[playerid][pLider] == 36) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Mercenarios"; ChosenSkin[para1] = 181; SetPlayerSkin(para1, 181); }
else if(PlayerInfo[playerid][pLider] == 37) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 12; ftext = "Rede TV Record"; ChosenSkin[para1] = 188; SetPlayerSkin(para1, 188); }
else if(PlayerInfo[playerid][pLider] == 30) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 12; ftext = "Piratas"; ChosenSkin[para1] = 252; SetPlayerSkin(para1, 252); }
else { return 1; }
org = PlayerInfo[playerid][pLider];
ConviteInfoOrg(para1, org, 1);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMembro] = PlayerInfo[playerid][pLider];
PlayerInfo[para1][pCargo] = 1;
printf("ADMIN CMD: %s convidou %s para entrar %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), "Voce foi convidado para a %s, pelo Lнder %s", ftext, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Voce convidou %s para a %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPlayerInterior(para1,0);
PlayerInfo[playerid][pCarLic] = 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][pMembro];
SelectCharPlace[para1] = 1;
PlayerInfo[para1][pModel] = ChosenSkin[para1];
PlayerInfo[para1][pChar] = ChosenSkin[para1];
SendClientMessage(para1, COLOR_LIGHTRED, "* Use 'Proximo' para trocar a skin.");
/ SendClientMessage(para1, COLOR_LIGHTRED, "* Quando voce achar a Skin preferida, Digite 'Confirmar'.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Este player ou e Procura / Tem Emprego ou / Familia");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nao esta autorizado para usar este cmd ( Apenas Lideres )!");
}
}
return 1;
}