pawn Код:
//----------------------------------[INVITE]------------------------------------------------
if(strcmp(cmd, "/Convidar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "-Use: /Convidar [ID]");
return 1;
}
new para1;
new ftext[20];
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (PlayerInfo[para1][pMember] <= 0 && PlayerInfo[para1][pLeader] <= 0 && PlayerInfo[para1][pEmprego] != 1 && PlayerInfo[para1][pEmprego] != 2)
{
if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "LAPD"; ChosenSkin[para1] = 267; SetPlayerSkin(para1, 267); }
else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Guarda Costeira"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71); }
else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Guarda Nacional"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "LAFD"; ChosenSkin[para1] = 274; SetPlayerSkin(para1, 274); }
else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI"; ChosenSkin[para1] = 165; SetPlayerSkin(para1, 165); }
else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "FARC"; ChosenSkin[para1] = 133; SetPlayerSkin(para1, 133); PlayerInfo[para1][pColombiano] = 1; }
else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "Prefeitura"; ChosenSkin[para1] = 113; SetPlayerSkin(para1, 113); }
else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 10; ftext = "Assassinos"; ChosenSkin[para1] = 122; SetPlayerSkin(para1, 122); }
else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Reporteres"; ChosenSkin[para1] = 147; SetPlayerSkin(para1, 147); }
else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "GISP"; ChosenSkin[para1] = 288; SetPlayerSkin(para1, 288); }
else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Instrutores"; ChosenSkin[para1] = 171; SetPlayerSkin(para1, 171); }
else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Grove Street"; ChosenSkin[para1] = 206; SetPlayerSkin(para1, 206); PlayerInfo[para1][pAlemao] = 1; }
else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Hamas"; ChosenSkin[para1] = 44; SetPlayerSkin(para1, 44); PlayerInfo[para1][pArabe] = 1; }
else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 17; gTeam[para1] = 17; ftext = "Triads"; ChosenSkin[para1] = 294; SetPlayerSkin(para1, 294); PlayerInfo[para1][pJapones] = 1; }
else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 18; gTeam[para1] = 18; ftext = "Varrios Los Aztecas"; ChosenSkin[para1] = 25; SetPlayerSkin(para1, 25); }
else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 19; gTeam[para1] = 19; ftext = "The Ballas"; ChosenSkin[para1] = 102; SetPlayerSkin(para1, 102); }
else if(PlayerInfo[playerid][pLeader] == 17) { PlayerInfo[para1][pTeam] = 20; gTeam[para1] = 20; ftext = "The Mafia"; ChosenSkin[para1] = 29; SetPlayerSkin(para1, 29); PlayerInfo[para1][pItaliano] = 1; }
else { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
PlayerInfo[para1][pCargo] = 1;
printf("ADMIN CMD: %s convidou %s para entrar %s.", sendername, giveplayer, ftext);
format(string, sizeof(string), "-Vocк foi recrutado para a Org. %s, pelo Lнder %s.", ftext, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "-Vocк recrutou o %s para a Org. %s.", giveplayer,ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SetPlayerInterior(para1,0);
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];
SendClientMessage(para1, COLOR_LIGHTRED, "- Use 'Proximo' para escolher a Skin Seguinte.");
SendClientMessage(para1, COLOR_LIGHTRED, "- Digite 'Confirma' para escolher a Skin Selecionada.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "-Esse jogador jб estб em uma Organizaзгo ou em Emrpego.");
return 1;
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "-Vocк nгo pode usar esse comando.");
}
}
return 1;
}