Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************************************************************************************************************************
- *****************************************************************************************************************************************************************************
- *****************************************************************************************************************************************************************************
- ***********************************************************************__________________************************************************************************************
- **********************************************************************| CreateClan |***********************************************************************************
- **********************************************************************| |***********************************************************************************
- **********************************************************************| By |***********************************************************************************
- **********************************************************************| Gireada |***********************************************************************************
- **********************************************************************| |***********************************************************************************
- **********************************************************************| |***********************************************************************************
- **********************************************************************| |***********************************************************************************
- **********************************************************************| |***********************************************************************************
- **********************************************************************| |***********************************************************************************
- **********************************************************************---------------------************************************************************************************
- */
- //Nu stergeti Creditele.
- #include <a_samp>
- #include <dini>
- #include <zcmd>
- #include <sscanf>
- #include <bdial>
- #define Creiat_de_Gireada
- forward SaveClans();
- forward LoadClans();
- forward SendClanMesaj(color,const string[],clanid);
- enum PlayerData
- {
- pCreateClan,
- pClan,
- pRank,
- pInvitation,
- pInvClan,
- pClanName,
- }
- new PlayerInfo[MAX_PLAYERS][PlayerData];
- enum ClanData
- {
- cID,
- cNume,
- cSkin1,
- cSkin2,
- cColor,
- cArma1,
- cArma2,
- cArma3,
- cArma4,
- cArma5,
- cArma6,
- cArma7,
- cRank,
- cLider,
- Float:cSpawnx,
- Float:cSpawny,
- Float:cSpawnz,
- Float:cAngle,
- cInterior,
- cVirtual,
- cMembri,
- }
- new ClanInfo[100][ClanData];
- public OnFilterScriptInit()
- {
- LoadClans();
- print("\n--------------------------------------");
- print(" Create Clan by Gireada");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Create Clan by Gireada");
- print("----------------------------------\n");
- }
- stock pName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- public OnPlayerConnect(playerid)
- {
- new file[35], clanname[MAX_PLAYERS];
- format(clanname, sizeof(clanname), "N/a");
- format(file, sizeof(file),"JucatoriClan/%s.ini", pName(playerid));
- if(dini_Exists(file))
- {
- PlayerInfo[playerid][pRank] = dini_Int(file,"Rank");
- PlayerInfo[playerid][pCreateClan] = dini_Int(file,"CreateClan");
- PlayerInfo[playerid][pClan] = dini_Int(file,"Clan");
- strmid(PlayerInfo[playerid][pClanName], dini_Get(file,"ClanNume"), 0, strlen(dini_Get(file,"ClanNume")), 255);
- }
- else if(!dini_Exists(file))
- {
- dini_Create(file);
- dini_IntSet(file,"Rank",PlayerInfo[playerid][pRank] = 0);
- dini_IntSet(file,"CreateClan",PlayerInfo[playerid][pCreateClan] = -1);
- dini_IntSet(file,"Clan",PlayerInfo[playerid][pClan] = -1);
- dini_Set(file,"ClanNume","N/a");
- }
- new clanid = PlayerInfo[playerid][pClan];
- if(ClanInfo[clanid][cNume] != PlayerInfo[playerid][pClanName])
- {
- dini_Set(file,"ClanNume","N/a");
- dini_IntSet(file,"Rank",0);
- dini_IntSet(file,"CreateClan",-1);
- dini_IntSet(file,"Clan",PlayerInfo[playerid][pClan] = -1);
- SendClientMessage(playerid, 0xFF0000AA, "Clanul sa desfintat!");
- }
- SendClientMessage(playerid, 0xFF0000AA, "Sistem de Clan creeat de Gireada! Contact: gireada09");
- SetPlayerColor(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cColor]);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma1], 1);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma2], 9999999);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma3], 9999999);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma4], 9999999);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma5], 9999999);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma6], 9999999);
- GivePlayerWeapon(playerid, ClanInfo[PlayerInfo[playerid][pClan]][cArma7], 9999999);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new clanid = PlayerInfo[playerid][pClan];
- if(PlayerInfo[playerid][pClan] >= 0)
- {
- SetPlayerPos(playerid,ClanInfo[clanid][cSpawnx],ClanInfo[clanid][cSpawny],ClanInfo[clanid][cSpawnz]);
- SetPlayerInterior(playerid, ClanInfo[clanid][cInterior]);
- SetPlayerVirtualWorld(playerid, ClanInfo[clanid][cVirtual]);
- }
- return 1;
- }
- CMD:setrank(playerid, params[])
- {
- new giveplayerid,rank,name[35],string[256];
- if(unformat(params, "ui", giveplayerid,rank))
- {
- SendClientMessage(playerid, 0xFF0000AA, "Usage: /setrank <playerid/name> <rank>");
- return 1;
- }
- if(rank < 0 && rank > 6)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Rank-ul pot fi de la 1 la 5");
- return 1;
- }
- new clanid = PlayerInfo[playerid][pClan];
- GetPlayerName(giveplayerid, name, sizeof(name));
- if(PlayerInfo[playerid][pRank] == 6)
- {
- if(PlayerInfo[giveplayerid][pClan] == PlayerInfo[playerid][pClan])
- {
- PlayerInfo[playerid][pRank] = rank;
- format(string, sizeof(string), " %s a primit rank %d", name, rank);
- SendClanMesaj(ClanInfo[clanid][cColor],string,clanid);
- }
- }
- return 1;
- }
- CMD:createclan(playerid, params[])
- {
- if(PlayerInfo[playerid][pCreateClan] == -1)
- {
- ShowPlayerDialog(playerid,10, DIALOG_STYLE_INPUT, "Create Clan", "Introdu numele clanului tau:", "Accept", "Cancel");
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "Ai creeat deja un clan!");
- }
- return 1;
- }
- CMD:invite(playerid, params[])
- {
- new giveplayerid, name[25], string[256];
- GetPlayerName(playerid, name, sizeof(name));
- if(unformat(params, "u", giveplayerid))
- {
- SendClientMessage(playerid, 0xFF0000AA, "Usage: /invite <playerid/name>");
- return 1;
- }
- if(giveplayerid == INVALID_PLAYER_ID)
- {
- SendClientMessage(playerid, 0xFF0000AA, "ID jucator invalid");
- }
- if(PlayerInfo[playerid][pRank] >= 5)
- {
- if(PlayerInfo[giveplayerid][pClan] == -1)
- {
- PlayerInfo[giveplayerid][pInvitation] = 1;
- PlayerInfo[giveplayerid][pInvClan] = PlayerInfo[playerid][pClan];
- format(string, sizeof(string), "%s te-a invitat in clanul %s. Scrie /accepta pentru a accepta.",name, ClanInfo[PlayerInfo[playerid][pClan]][cNume]);
- SendClientMessage(giveplayerid, 0xFF0000AA, string);
- SendClientMessage(playerid, 0xFF0000AA, "Scrie /accepta pentru a accepta");
- SendClientMessage(playerid, 0xFF0000AA, "Scrie /refuza pentru al refuza");
- }
- }
- return 1;
- }
- CMD:accepta(playerid, params[])
- {
- if(PlayerInfo[playerid][pInvitation] == 1)
- {
- new name[MAX_PLAYER_NAME], file[512], file2[512];
- new string[256];
- new clanid = PlayerInfo[playerid][pClan];
- GetPlayerName(playerid,name,sizeof(name));
- format(file, sizeof(file),"JucatoriClan/%s.ini", name);
- format(file2, sizeof(file2),"Clans/%d.ini", clanid);
- GetPlayerName(playerid, name, sizeof(name));
- dini_IntSet(file,"Clan",PlayerInfo[playerid][pInvClan]);
- dini_IntSet(file,"Rank",1); dini_IntSet(file2,"Membri",ClanInfo[clanid][cMembri]+1);
- PlayerInfo[playerid][pInvClan] = 0;
- PlayerInfo[playerid][pInvitation] = 0;
- dini_IntSet(file,"ClanNume",ClanInfo[clanid][cNume]);
- format(string, sizeof(string), "%s s-a alaturat clanului.",name);
- SendClanMesaj(ClanInfo[clanid][cColor],string,clanid);
- }
- return 1;
- }
- CMD:refuza(playerid, params[])
- {
- if(PlayerInfo[playerid][pInvitation] == 1)
- {
- new name[25], string[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s a refuzat invitatia clanului.",name);
- SendClanMesaj(0xFF0000AA,string,PlayerInfo[playerid][pInvClan]);
- PlayerInfo[playerid][pInvClan] = 0;
- }
- return 1;
- }
- CMD:claniesi(playerid, params[])
- {
- new name[MAX_PLAYER_NAME], file[512], file2[512];
- new clanid = PlayerInfo[playerid][pClan];
- GetPlayerName(playerid,name,sizeof(name));
- format(file, sizeof(file),"JucatoriClan/%s.ini", name);
- format(file2, sizeof(file2),"Clans/%d.ini", clanid);
- if(PlayerInfo[playerid][pRank] <= 5)
- {
- new name2[25], string[256];
- GetPlayerName(playerid, name2, sizeof(name2));
- format(string, sizeof(string), "%s a iesit din clan.",name2);
- SendClanMesaj(0xFF0000AA,string,PlayerInfo[playerid][pInvClan]);
- dini_IntSet(file2,"Membri",ClanInfo[clanid][cMembri]-1);
- dini_IntSet(file,"Clan",-1);
- dini_IntSet(file,"Rank",0);
- dini_Set(file,"ClanNume","N/a");
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "Esti liderul clanului, nu poti iesi. Foloseste /desclan");
- }
- return 1;
- }
- CMD:desclan(playerid, params[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[35], file2[35];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(PlayerInfo[playerid][pRank] == 6)
- {
- for(new i=1;i<MAX_PLAYERS;i++)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(i,name,sizeof(name));
- format(file2, sizeof(file2),"JucatoriClan/%s.ini", name);
- if(PlayerInfo[i][pClan] == clanid)
- {
- dini_IntSet(file2,"Clan",-1);
- dini_IntSet(file2,"CreateClan",0);
- dini_Set(file2,"ClanNume","N/a");
- SendClientMessage(playerid, 0xFF0000AA, "Clanul s-a desfintat");
- }
- }
- dini_Set(file,"Nume","N/a");
- dini_Set(file,"Lider","N/a");
- dini_IntSet(file2,"Clan",-1);
- dini_IntSet(file2,"CreateClan",0);
- }
- return 1;
- }
- CMD:setspawn(playerid, params[])
- {
- new Float:x, Float:y, Float:z, file[256];
- GetPlayerPos(playerid, x, y, z);
- new Float:Angle, string[100];
- GetPlayerFacingAngle(playerid, Angle);
- new clanid = PlayerInfo[playerid][pClan];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(PlayerInfo[playerid][pRank] == 6)
- {
- dini_FloatSet(file,"Spawnx",x);
- dini_FloatSet(file,"Spawny",y);
- dini_FloatSet(file,"Spawnz",z);
- dini_FloatSet(file,"Rotatie",Angle);
- dini_IntSet(file,"Virtual",GetPlayerVirtualWorld(playerid));
- dini_IntSet(file,"Virtual",GetPlayerInterior(playerid));
- format(string, sizeof(string), "Ai setat spawn-ul clanului la %d %d %d", x,y,z);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "[ClanInfo] Trebuie sa fii liderul clanului, pentru a folosi comanda.");
- }
- return 1;
- }
- CMD:clist(playerid, params[])
- {
- new name[256], string[256];
- if(PlayerInfo[playerid][pClan] >= 0)
- {
- for(new i=1;i<MAX_PLAYERS;i++)
- {
- GetPlayerName(i,name,sizeof(name));
- if(PlayerInfo[i][pClan] == PlayerInfo[playerid][pClan])
- {
- if(PlayerInfo[i][pRank] == 6)
- {
- format(string, 256, "** Fondator ** %s", name);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- else if(PlayerInfo[i][pRank] == 5)
- {
- format(string, 256, "** Rank 5 ** %s", name);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- else if(PlayerInfo[i][pRank] == 4)
- {
- format(string, 256, "** Rank 4 ** %s", name);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- else if(PlayerInfo[i][pRank] == 3)
- {
- format(string, 256, "** Rank 3 ** %s", name);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- else if(PlayerInfo[i][pRank] == 2)
- {
- format(string, 256, "** Rank 2 ** %s", name);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- else if(PlayerInfo[i][pRank] == 1)
- {
- format(string, 256, "** Rank 1 ** %s", name);
- SendClientMessage(playerid, 0xFF0000AA, string);
- }
- }
- }
- }
- else if(PlayerInfo[playerid][pClan] == -1)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Nu esti intr-un clan");
- }
- return 1;
- }
- CMD:clanchat(playerid, params[])
- {
- new text[1000], string[256], name[35];
- if(unformat(params, "s[1000]", text))
- {
- SendClientMessage(playerid, 0xFF0000AA, "Usage: /clanchat <clancheat>");
- return 1;
- }
- if(PlayerInfo[playerid][pClan] >= 0)
- {
- GetPlayerName(playerid,name,sizeof(name));
- format(string, sizeof(string), "[ClanChat] [%d] [%s]: {FFFFFF}%s", PlayerInfo[playerid][pRank],name,text);
- SendClanMesaj(ClanInfo[PlayerInfo[playerid][pClan]][cColor],string,PlayerInfo[playerid][pClan]);
- }
- return 1;
- }
- DIAL:10(playerid, bool:response, listitem, inputtext[])
- {
- new name[MAX_PLAYER_NAME], ClanName[MAX_PLAYER_NAME], file[254], file2[254];
- format(file2, sizeof(file2), "JucatoriClan/%s.ini", pName(playerid));
- format(ClanName, sizeof(ClanName), "N/a");
- GetPlayerName(playerid,name,sizeof(name));
- for(new i=0;i<100;i++)
- {
- format(file, sizeof(file),"Clans/%d.ini", i);
- if(ClanInfo[i][cID] == -1)
- {
- dini_Set(file,"Nume",inputtext); dini_Set(file2,"ClanNume",inputtext);
- dini_IntSet(file2,"Rank",6);
- dini_IntSet(file2,"Clan",i);
- dini_IntSet(file2,"CreateClan",1);
- dini_Set(file,"Lider",name);
- dini_IntSet(file,"ClanId",i);
- //
- break;
- }
- }
- ShowPlayerDialog(playerid,11, DIALOG_STYLE_LIST, "Arme Clan", "Crosa\nBaston\nCutit\nBata\nLopata\nTac\nKatana\nDrujba", "Accept", "Anulez");
- return 1;
- }
- DIAL:11(playerid, bool:response, listitem, inputtext[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 2; dini_IntSet(file,"Arma1",2);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\n Silent 9mm\n Desert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 3; dini_IntSet(file,"Arma1",3);
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 4; dini_IntSet(file,"Arma1",4);
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 5; dini_IntSet(file,"Arma1",5);
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 6; dini_IntSet(file,"Arma1",6);
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 7; dini_IntSet(file,"Arma1",7);
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 8; dini_IntSet(file,"Arma1",8);
- }
- if(listitem == 7)
- {
- ShowPlayerDialog(playerid,12, DIALOG_STYLE_LIST, "Arme Clan", "9mm\nSilent 9mm\nDesert Eagle", "Accept", "Anulez");
- ClanInfo[clanid][cArma1] = 9; dini_IntSet(file,"Arma1",9);
- }
- return 1;
- }
- DIAL:12(playerid, bool:response, listitem, inputtext[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,13, DIALOG_STYLE_LIST, "Arme Clan", "ShoutGun\nSawnoff Shotgun\nCombat Shotgun", "Accept", "Anulez");
- ClanInfo[clanid][cArma2] = 22; dini_IntSet(file,"Arma2",22);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,13, DIALOG_STYLE_LIST, "Arme Clan", "ShoutGun\nSawnoff Shotgun\nCombat Shotgun", "Accept", "Anulez");
- ClanInfo[clanid][cArma2] = 23; dini_IntSet(file,"Arma2",23);
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,13, DIALOG_STYLE_LIST, "Arme Clan", "ShoutGun\nSawnoff Shotgun\nCombat Shotgun", "Accept", "Anulez");
- ClanInfo[clanid][cArma2] = 24; dini_IntSet(file,"Arma2",24);
- }
- return 1;
- }
- DIAL:13(playerid, bool:response, listitem, inputtext[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,14, DIALOG_STYLE_LIST, "Arme Clan", "Micro SMG\nMP5", "Accept", "Anulez");
- ClanInfo[clanid][cArma3] = 25; dini_IntSet(file,"Arma3",25);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,14, DIALOG_STYLE_LIST, "Arme Clan", "Micro SMG\nMP5", "Accept", "Anulez");
- ClanInfo[clanid][cArma3] = 26; dini_IntSet(file,"Arma3",26);
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,14, DIALOG_STYLE_LIST, "Arme Clan", "Micro SMG\nMP5", "Accept", "Anulez");
- ClanInfo[clanid][cArma3] = 27; dini_IntSet(file,"Arma3",27);
- }
- return 1;
- }
- DIAL:14(playerid, bool:response, listitem, inputtext[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,15, DIALOG_STYLE_LIST, "Arme Clan", "Ak-47\nM5", "Accept", "Anulez");
- ClanInfo[clanid][cArma4] = 28; dini_IntSet(file,"Arma4",28);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,15, DIALOG_STYLE_LIST, "Arme Clan", "Ak-47\nM5", "Accept", "Anulez");
- ClanInfo[clanid][cArma4] = 29; dini_IntSet(file,"Arma4",29);
- }
- return 1;
- }
- DIAL:15(playerid, bool:response, listitem, inputtext[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,16, DIALOG_STYLE_LIST, "Arme Clan", "Country Rifle\nSniper Rifle", "Accept", "Anulez");
- ClanInfo[clanid][cArma5] = 30; dini_IntSet(file,"Arma5",30);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,16, DIALOG_STYLE_LIST, "Arme Clan", "Country Rifle\nSniper Rifle", "Accept", "Anulez");
- ClanInfo[clanid][cArma5] = 31; dini_IntSet(file,"Arma5",31);
- }
- return 1;
- }
- DIAL:16(playerid, bool:response, listitem, inputtext[])
- {
- new clanid = PlayerInfo[playerid][pClan];
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", clanid);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,17, DIALOG_STYLE_LIST, "Culoare", "{FF0000}Rosu\n{0000FF}Albastru\n{FF00FF}Mov\n{FFFF00}Galben\n{00FF00}Verde\n{00FFFF}Cyan\n{C0C0C0}Gri", "Accept", "Anulez");
- ClanInfo[clanid][cArma6] = 33; dini_IntSet(file,"Arma6",33);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,17, DIALOG_STYLE_LIST, "Culoare", "{FF0000}Rosu\n{0000FF}Albastru\n{FF00FF}Mov\n{FFFF00}Galben\n{00FF00}Verde\n{00FFFF}Cyan\n{C0C0C0}Gri", "Accept", "Anulez");
- ClanInfo[clanid][cArma6] = 34; dini_IntSet(file,"Arma6",33);
- }
- }
- DIAL:17(playerid, bool:response, listitem, inputtext[])
- {
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", PlayerInfo[playerid][pClan]);
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0xFF0000");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0x0000FF");
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0xFF00FF");
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0xFFFF00");
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0x00FF00");
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0x00FFFF");
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- dini_Set(file,"Culoare","0xC0C0C0");
- }
- return 1;
- }
- DIAL:18(playerid, bool:response, listitem, inputtext[])
- {
- new file[512];
- format(file, sizeof(file),"Clans/%d.ini", PlayerInfo[playerid][pClan]);
- new skinid = strval(inputtext);
- if(!IsValidSkin(skinid))
- {
- ShowPlayerDialog(playerid,18, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- }
- else
- {
- dini_Set(file,"Skin1",inputtext);
- ShowPlayerDialog(playerid,19, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului2:", "Accept", "Cancel");
- }
- return 1;
- }
- DIAL:19(playerid, bool:response, listitem, inputtext[])
- {
- new file[512], file2[512];
- format(file, sizeof(file),"Clans/%d.ini", PlayerInfo[playerid][pClan]);
- format(file2, sizeof(file2), "JucatoriClan/%s.ini", pName(playerid));
- new skinid = strval(inputtext);
- if(!IsValidSkin(skinid))
- {
- ShowPlayerDialog(playerid,19, DIALOG_STYLE_INPUT, "Skin Clan", "Introdu id-ul skinului:", "Accept", "Cancel");
- }
- else
- {
- dini_Set(file,"Skin2",inputtext);
- dini_IntSet(file2,"CreateClan",1);
- dini_IntSet(file2,"Rank",6);
- }
- return 1;
- }
- public LoadClans()
- {
- new file[512];
- for(new idx=0;idx<100;idx++)
- {
- format(file, sizeof(file),"Clans/%d.ini", idx);
- if(dini_Exists(file))
- {
- ClanInfo[idx][cID] = dini_Int(file,"ClanId");
- strmid(ClanInfo[idx][cNume], dini_Get(file,"Nume"), 0, strlen(dini_Get(file,"Nume")), 255);
- ClanInfo[idx][cSkin1] = dini_Int(file,"Skin1");
- ClanInfo[idx][cSkin2] = dini_Int(file,"Skin2");
- ClanInfo[idx][cColor] = dini_Int(file,"Culoare");
- ClanInfo[idx][cArma1] = dini_Int(file,"Arma1");
- ClanInfo[idx][cArma2] = dini_Int(file,"Arma2");
- ClanInfo[idx][cArma3] = dini_Int(file,"Arma3");
- ClanInfo[idx][cArma4] = dini_Int(file,"Arma4");
- ClanInfo[idx][cArma5] = dini_Int(file,"Arma5");
- ClanInfo[idx][cArma6] = dini_Int(file,"Arma6");
- ClanInfo[idx][cArma7] = dini_Int(file,"Arma7");
- strmid(ClanInfo[idx][cLider], dini_Get(file,"Lider"), 0, strlen(dini_Get(file,"Lider")), 255);
- ClanInfo[idx][cSpawnx] = dini_Float(file,"Spawnx");
- ClanInfo[idx][cSpawny] = dini_Float(file,"Spawny");
- ClanInfo[idx][cSpawnz] = dini_Float(file,"Spawnz");
- ClanInfo[idx][cAngle] = dini_Float(file,"Rotatie");
- ClanInfo[idx][cInterior] = dini_Int(file,"Interior");
- ClanInfo[idx][cVirtual] = dini_Int(file,"Virtual");
- ClanInfo[idx][cMembri] = dini_Int(file,"Membri");
- }
- else if(!dini_Exists(file))
- {
- dini_Create(file);
- dini_IntSet(file,"ClanId",ClanInfo[idx][cID] = -1);
- dini_Set(file,"Nume","N/a");
- dini_IntSet(file,"Skin1",ClanInfo[idx][cSkin1] = 0);
- dini_IntSet(file,"Skin2",ClanInfo[idx][cSkin2] = 0);
- dini_IntSet(file,"Culoare",ClanInfo[idx][cColor] = 0);
- dini_IntSet(file,"Arma1",ClanInfo[idx][cArma1] = 0);
- dini_IntSet(file,"Arma2",ClanInfo[idx][cArma2] = 0);
- dini_IntSet(file,"Arma3",ClanInfo[idx][cArma3] = 0);
- dini_IntSet(file,"Arma4",ClanInfo[idx][cArma4] = 0);
- dini_IntSet(file,"Arma5",ClanInfo[idx][cArma5] = 0);
- dini_IntSet(file,"Arma6",ClanInfo[idx][cArma6] = 0);
- dini_IntSet(file,"Arma7",ClanInfo[idx][cArma7] = 0);
- dini_Set(file,"Lider", "N/a");
- dini_FloatSet(file,"Spawnx",ClanInfo[idx][cSpawnx]);
- dini_FloatSet(file,"Spawny",ClanInfo[idx][cSpawny]);
- dini_FloatSet(file,"Spawnz",ClanInfo[idx][cSpawnz]);
- dini_FloatSet(file,"Rotatie",ClanInfo[idx][cAngle]);
- dini_IntSet(file,"Interior",ClanInfo[idx][cInterior] = 0);
- dini_IntSet(file,"Virtual",ClanInfo[idx][cVirtual] = -1);
- dini_IntSet(file,"Membri",ClanInfo[idx][cMembri] = 0);
- }
- }
- return 1;
- }
- public SendClanMesaj(color,const string[],clanid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (PlayerInfo[i][pClan] == clanid)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- return 1;
- }
- IsValidSkin(skinid)
- {
- #define MAX_BAD_SKINS 22
- new badSkins[MAX_BAD_SKINS] =
- {
- 3, 4, 5, 6, 8, 42, 65, 74, 86,
- 119, 149, 208, 265, 266, 267,
- 268, 269, 270, 271, 272, 273, 289
- };
- if (skinid < 0 || skinid > 299) return false;
- for (new i = 0; i < MAX_BAD_SKINS; i++)
- {
- if (skinid == badSkins[i]) return false;
- }
- #undef MAX_BAD_SKINS
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement