15.11.2012, 16:08
Estou pretendendo criar mais orgs no meu gamemode mais eu n sei como faзo para colocar para convidar tipo o lider digita /convidar ai convida || digita /demitir ai demiti || digita /promover ai promove || digita /darlider ai da lider
Codes
Codes
pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidar [playerid/Parte-do-Nick]");
return true;
}
new para1;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLider] >= 1 || PlayerInfo[playerid][pCargo] == 5)
{
new lolz = GetPlayerOrg(playerid);
if(TemVaga(lolz) == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparvaga primeiro.");
return true;
}
if(IsPlayerConnected(para1))
{
if(PlayerInfo[para1][pMembro] != 0 || PlayerInfo[para1][pLider] != 0)
{
SendClientMessage(playerid, COLOR_GREY, "Este player jб participa de Org/Gang/Mafia.");
return true;
}
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
/*ShowPlayerDialog(para1, 642, DIALOG_STYLE_MSGBOX, "Convite", "{E679F2}Vocк foi convidado para uma organizaзгo: %s \n{63ACFF}Deseja entrar para a organizaзгo ?", "Sim", "Nao", NomeORG(playerid));
format(string, sizeof(string), "* {F2D61F}%s {E3E3E3}te convidou para entrar para: {F2D61F}%s. Sim {E3E3E3}- {3EF02E}Aceita {E3E3E3}| {FF4053}Nгo {E3E3E3}- Recusa.", PlayerName(playerid), NomeORG(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);*/
format(string, sizeof(string), "* Vocк convidou %s para sua organizaзгo: %s.", giveplayer,NomeORG(playerid));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new convitestring[256];
format(convitestring,sizeof(convitestring), "{E679F2}Vocк foi convidado para uma organizaзгo: %s \n{63ACFF}Deseja entrar para a organizaзгo ?",NomeORG(playerid));
ShowPlayerDialog(para1,642,DIALOG_STYLE_MSGBOX,"Convite",convitestring,"Sim","Nao");
InviteOffer[para1] = playerid;
InviteJob[para1] = lolz;
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Somente lнderes podem usar este comando !");
}
}
return true;
}
pawn Код:
if(strcmp(cmd, "/Demitir", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "/Demitir [ID/NICK] [Motivo]");
return true;
}
new para1;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pLider] > 0 || PlayerInfo[playerid][pCargo] == 5)
{
new lolz = GetPlayerOrg(playerid);
if(PlayerInfo[para1][pMembro] != lolz)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode demitir quem nгo й da sua org.");
return true;
}
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if (PlayerInfo[para1][pMembro] > 0)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /Demitir [ID/NICK] [Motivo]");
return true;
}
DemitirInfoOrg(PlayerName(para1));
format(string, sizeof(string), "* Vocк foi demitido pelo lнder %s Motivo: %s.", sendername, (result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
SendClientMessage(para1, COLOR_LIGHTBLUE, "* Agora vocк й um civil novamente.");
gTeam[para1] = 3;
PlayerInfo[para1][pTeam] = 3;
PlayerInfo[para1][pMembro] = 0;
PlayerInfo[para1][pCargo] = 0;
if(PlayerInfo[para1][pSex] == 1) { PlayerInfo[para1][pSkin] = 23; } else { PlayerInfo[para1][pSkin] = 41; }
SetSpawnInfo(para1, gTeam[para1], PlayerInfo[para1][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
MedicBill[para1] = 0;
SpawnPlayer(para1);
format(string, sizeof(string), "Vocк demitiu %s, Motivo: %s.", giveplayer, result);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return true;
}
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um lнder!");
}
return true;
}
pawn Код:
if(strcmp(cmd, "/promover", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Use: /Promover [ID/Nick] [Cargos (1-5)]");
return true;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 5 || level < 1) { SendClientMessage(playerid, COLOR_GREY, " Cargos de 1 a 5, Cargo 5 й Sub-Lнder!"); return true; }
if (PlayerInfo[playerid][pLider] > 0)
{
if(IsPlayerConnected(para1))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[para1][pMembro] == PlayerInfo[playerid][pLider])
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pCargo] = level;
format(string, sizeof(string), " Vocк foi promovido pelo lнder %s", PlayerName(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк promoveu %s a cargo %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
new org = PlayerInfo[playerid][pLider];
if(level == 5)
{
if(strcmp(InfoOrg[org][SubLider],"Ninguem",true)==0)
{
DemitirInfoOrg(giveplayer);
ConviteInfoOrg(giveplayer, org, 5);
}
else
{
strmid(string, InfoOrg[org][SubLider], 0, strlen(InfoOrg[org][SubLider]), 255);
DemitirInfoOrg(giveplayer);
DemitirInfoOrg(InfoOrg[org][SubLider]);
ConviteInfoOrg(string, org, 4);
ConviteInfoOrg(giveplayer, org, 5);
}
}
if(strcmp(InfoOrg[org][SubLider],giveplayer,true)==0)
{
if(level < 5)
{
DemitirInfoOrg(giveplayer);
ConviteInfoOrg(giveplayer, org, level);
}
}
return true;
}
if(PlayerInfo[para1][pMembro] != PlayerInfo[playerid][pLider])
{
SendClientMessage(playerid, COLOR_GREY, "Nгo pode promover quem nгo й da sua org.");
return true;
}
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um lнder !");
}
}
return true;
}
pawn Код:
if(strcmp(cmd, "/darlider", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darlider [id] [Numero(1-25)]");
return true;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level == 0) { SendClientMessage(playerid, COLOR_GREY, "Para tirar o lider de uma organizaзгo vocк deve usar /limparlider"); return true; }
if(level > 26 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Empregos de 1 a 25"); return true; }
GetPlayerName(playerid, sendername, 256);
if (PlayerInfo[playerid][pAdmin] >= MASTER)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != DONO)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return true;
}
if(PlayerInfo[para1][pLider] != 0 || PlayerInfo[para1][pMembro] != 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " Este player jб participa de uma organizaзгo!");
return true;
}
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(strcmp(InfoOrg[level][Lider],"Ninguem",true)==0)
{
ConviteInfoOrg(PlayerName(para1), level, 6);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Jб tem lнder nessa ORG, use /limparlider antes de colocar outro lider");
return true;
}
if(level == 1) { PlayerInfo[para1][pSkin] = 265; }//Policia Militar
else if(level == 2) { PlayerInfo[para1][pSkin] = 285; }//B.O.P.E
else if(level == 3) { PlayerInfo[para1][pSkin] = 287; }//Exйrcito
else if(level == 4) { PlayerInfo[para1][pSkin] = 70; }//Fire/Ambulance
else if(level == 5) { PlayerInfo[para1][pSkin] = 115; }//Varrios Los Aztecas
else if(level == 6) { PlayerInfo[para1][pSkin] = 249; }//Hamas
else if(level == 7) { PlayerInfo[para1][pSkin] = 147; }//Prefeito
else if(level == 8) { PlayerInfo[para1][pSkin] = 294; }//Hitmans
else if(level == 9) { PlayerInfo[para1][pSkin] = 227; }//Repуrters
else if(level == 10) { PlayerInfo[para1][pSkin] = 61; }//Taxistas
else if(level == 11) { PlayerInfo[para1][pSkin] = 295; }//Policia Federal
else if(level == 12) { PlayerInfo[para1][pSkin] = 113; }//Mбfia Cosa Nostra
else if(level == 13) { PlayerInfo[para1][pSkin] = 120; }//Mбfia Yakuza
else if(level == 14) { PlayerInfo[para1][pSkin] = 270; }//Groove
else if(level == 15) { PlayerInfo[para1][pSkin] = 123; }//ALQaeda
else if(level == 16) { PlayerInfo[para1][pSkin] = 186; }//Policia Civil
else if(level == 17) { PlayerInfo[para1][pSkin] = 104; }//Ballas
else if(level == 18) { PlayerInfo[para1][pSkin] = 108; }//Vagos
else if(level == 19) { PlayerInfo[para1][pSkin] = 19; }//CV
else if(level == 20) { PlayerInfo[para1][pSkin] = 248; }//Sons of Anarchy
else if(level == 21) { PlayerInfo[para1][pSkin] = 292; }//Drifters
else if(level == 22) { PlayerInfo[para1][pSkin] = 117; }//Triads
else if(level == 23) { PlayerInfo[para1][pSkin] = 111; }//FARC
else if(level == 24) { PlayerInfo[para1][pSkin] = 299; }//Os Motoqueiros
else if(level == 25) { PlayerInfo[para1][pSkin] = 61; }//FAB
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLider] = level;
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
SendClientMessage(para1, COLOR_LIGHTBLUE, " Vocк foi promovido a lider pelo admin Homem_Aranha");
}
else
{
format(string, sizeof(string), " Vocк foi promovido a lider pelo admin %s", PlayerName(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
}
SendClientMessage(para1, COLOR_LIGHTBLUE," Promovido Com sucesso !!");
format(string, sizeof(string), " Vocк promoveu %s a Lider.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "ADMIN: %s deu lнder da org:[%s] para %s.", sendername, NomeORG(level), giveplayer);
LideresLog(string);
MedicBill[para1] = 0;
gTeam[para1] = 11;
PlayerInfo[para1][pTeam] = 11;
PlayerInfo[para1][pCargo] = 6;
SetPlayerSkin(para1, PlayerInfo[para1][pSkin]);
SetPlayerSpawn(para1);
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
}
}
return true;
}