25.11.2014, 22:59
I want to make player sends a request leader.
I know make simple command but this command is too high to make.
I know make simple command but this command is too high to make.
Код:
CMD:joinorg(playerid, params[]) { if(IsPlayerConnected(playerid)) { new string[128], sendername[MAX_PLAYER_NAME],giveplayerid,giveplayer[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(sscanf(params,"u",giveplayerid)) return SCM(playerid, COLOR_GRAD2, "Koriscenje: /joinorg [ID Igraca/Deo Imena]"); new ftext[32]; if(PlayerInfo[playerid][pLeader] >= 1) { if(giveplayerid != INVALID_PLAYER_ID) { if(gTeam[giveplayerid]==TEAM_GREEN && PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pFMember] == 255) { if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[giveplayerid][pTeam] = 2; gTeam[giveplayerid] = 2; ftext = "Policija"; ChosenSkin[giveplayerid] = 71; SetPlayerSkin(giveplayerid, 71); } else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[giveplayerid][pTeam] = 2; gTeam[giveplayerid] = 2; ftext = "FBI/ATF"; ChosenSkin[giveplayerid] = 286; SetPlayerSkin(giveplayerid, 286); } else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[giveplayerid][pTeam] = 2; gTeam[giveplayerid] = 2; ftext = "JSO"; ChosenSkin[giveplayerid] = 287; SetPlayerSkin(giveplayerid, 287); } else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[giveplayerid][pTeam] = 1; gTeam[giveplayerid] = 1; ftext = "Ambulanta"; ChosenSkin[giveplayerid] = 70; SetPlayerSkin(giveplayerid, 70); } else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[giveplayerid][pTeam] = 1; gTeam[giveplayerid] = 1; ftext = "Vatrogasci"; ChosenSkin[giveplayerid] = 70; SetPlayerSkin(giveplayerid, 70); } else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 5; ftext = "Varrios Los Aztecas"; ChosenSkin[giveplayerid] = 116; SetPlayerSkin(giveplayerid, 116); } else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 5; ftext = "Sons of Anarchy"; ChosenSkin[giveplayerid] = 248; SetPlayerSkin(giveplayerid, 248); } else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[giveplayerid][pTeam] = 6; gTeam[giveplayerid] = 6; ftext = "La Famillia Teller"; ChosenSkin[giveplayerid] = 46; SetPlayerSkin(giveplayerid, 46); } else if(PlayerInfo[playerid][pLeader] == 7) { return 1; } else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[giveplayerid][pTeam] = 10; gTeam[giveplayerid] = 12; ftext = "Hitman Agency"; ChosenSkin[giveplayerid] = 249; SetPlayerSkin(giveplayerid, 249); } else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[giveplayerid][pTeam] = 12; gTeam[giveplayerid] = 12; ftext = "RTS"; ChosenSkin[giveplayerid] = 148; SetPlayerSkin(giveplayerid, 148); } else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[giveplayerid][pTeam] = 12; gTeam[giveplayerid] = 12; ftext = "Taxi Cab Company"; ChosenSkin[giveplayerid] = 255; SetPlayerSkin(giveplayerid, 255); } else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[giveplayerid][pTeam] = 12; gTeam[giveplayerid] = 12; ftext = "School Instructors"; ChosenSkin[giveplayerid] = 59; SetPlayerSkin(giveplayerid, 59); } else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Yamaguchi"; ChosenSkin[giveplayerid] = 169; SetPlayerSkin(giveplayerid, 169); } else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[giveplayerid][pTeam] = 15; gTeam[giveplayerid] = 15; ftext = "LCN"; ChosenSkin[giveplayerid] = 258; SetPlayerSkin(giveplayerid, 258); } else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Black Dragons"; ChosenSkin[giveplayerid] = 143; SetPlayerSkin(giveplayerid, 143); } else if(PlayerInfo[playerid][pLeader] == 17) { PlayerInfo[giveplayerid][pTeam] = 12; gTeam[giveplayerid] = 12; ftext = "Parking Servis"; ChosenSkin[giveplayerid] = 16; SetPlayerSkin(giveplayerid, 16); } else if(PlayerInfo[playerid][pLeader] == 18) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Grove Street"; ChosenSkin[giveplayerid] = 106; SetPlayerSkin(giveplayerid, 106); } else if(PlayerInfo[playerid][pLeader] == 19) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Yakuza (Priv. Org.)"; if(PlayerInfo[playerid][pSex] == 1) { ChosenSkin[giveplayerid] = 59; SetPlayerSkin(giveplayerid, 59); } else if(PlayerInfo[playerid][pSex] == 2) { ChosenSkin[giveplayerid] = 12; SetPlayerSkin(giveplayerid, 12); } } else if(PlayerInfo[playerid][pLeader] == 20) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Ballas (Priv. Org.)"; ChosenSkin[giveplayerid] = 102; SetPlayerSkin(giveplayerid, 102); } else if(PlayerInfo[playerid][pLeader] == 21) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Russian Mafia (Priv. Org.)"; ChosenSkin[giveplayerid] = 121; SetPlayerSkin(giveplayerid, 121); } else if(PlayerInfo[playerid][pLeader] == 22) { PlayerInfo[giveplayerid][pTeam] = 2; gTeam[giveplayerid] = 12; ftext = "Vatrogasci (Drzavna. Org.)"; ChosenSkin[giveplayerid] = 143; SetPlayerSkin(giveplayerid, 143); } else if(PlayerInfo[playerid][pLeader] == 23) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Street Ultras (Priv. Org.)"; ChosenSkin[giveplayerid] = 206; SetPlayerSkin(giveplayerid, 206); } else if(PlayerInfo[playerid][pLeader] == 24) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "Srpska Mafija (Priv. Org.)"; ChosenSkin[giveplayerid] = 59; SetPlayerSkin(giveplayerid, 59); } else if(PlayerInfo[playerid][pLeader] == 25) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "LCM (Priv. Org.)"; ChosenSkin[giveplayerid] = 240; SetPlayerSkin(giveplayerid, 240); } else if(PlayerInfo[playerid][pLeader] == 26) { PlayerInfo[giveplayerid][pTeam] = 5; gTeam[giveplayerid] = 12; ftext = "TnT (Priv. Org.)"; ChosenSkin[giveplayerid] = 240; SetPlayerSkin(giveplayerid, 240); } else { return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); PlayerInfo[giveplayerid][pMember] = PlayerInfo[playerid][pLeader]; PlayerInfo[giveplayerid][pRank] = 1; printf("AdmCMD: %s je pozvan %s da udje %s.", sendername, giveplayer, ftext); format(string, sizeof(string), " Primljeni ste u organizaciju %s, pozvani ste od strane lidera %s", ftext, sendername); SCM(giveplayerid, COLOR_WHITE, string); format(string, sizeof(string), " Vi ste pozvani %s da udjete u organizaciju %s.", giveplayer,ftext); SCM(playerid, COLOR_WHITE, string); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s je ubacio clana %s u svoju organizaciju (%s).",d,m,y,h,mi,s,sendername,giveplayer,ftext); UninviteLog(string); } else { SCM(playerid, COLOR_GREY, " Igrac ima wanted ili je clan neke organizacije."); return 1; } } } else { SCM(playerid, COLOR_GRAD1, " Niste ovlasceni da koristite ovu komandu!(Lideri samo)!"); } } return 1; }