Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:accept(playerid, params[], help) {
- if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) {
- SendClientMessage(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda deoarece nu te-ai autentificat cu codul de securitate.");
- SendClientMessage(playerid, COLOR_GREY, "Pentru a te autentifica, foloseste comanda '/loginpin'!");
- return 1;
- }
- new x_job[180],id,sendername[25],giveplayer[25],string[500];
- if(sscanf(params, "s[180]u",x_job,id))
- {
- SendClientMessage(playerid, COLOR_GREY, "USAGE: {FFFFFF}/accept <item> <playerid/name>");
- SendClientMessage(playerid, COLOR_WHITE, "Trade, Dice, Drugs, Repair, Materials,");
- SCM(playerid, -1, "Live, Free, Ticket, Refill, Invite, Lesson, Cinvite, Clan, Propose.");
- return 1;
- }
- if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat.");
- if(strcmp(x_job,"medic",true) == 0 || strcmp(x_job,"taxi",true) == 0 || strcmp(x_job,"mecanic",true) == 0 || strcmp(x_job,"instructor",true) == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Aceasta comanda nu mai este disponibila. Foloseste /calls!");
- if(strcmp(x_job,"propose",true) == 0) {
- if(GetPVarInt(playerid, "proposeID") != id) return SCM(playerid, COLOR_GREY, "Acel player nu ti-a facut o cerere!");
- if(strcmp(PlayerInfo[playerid][pPropose], "Nimeni", true) == 0) { }
- else return SCM(playerid, COLOR_LGREEN, "Eroare: Esti deja casatorit(a)!");
- if(PlayerInfo[playerid][pSex] == PlayerInfo[id][pSex]) {
- if(PlayerInfo[playerid][pSex] == 1) format(string, sizeof(string), "Avem un nou cuplu de homosexuali, %s si %s s-au casatorit.", GetName(id), GetName(playerid));
- else if(PlayerInfo[playerid][pSex] == 2) format(string, sizeof(string), "Avem un nou cuplu de lesbiene, %s si %s s-au casatorit.", GetName(id), GetName(playerid));
- }
- else format(string, sizeof(string), "Avem un nou cuplu de indragostiti, %s si %s s-au casatorit.", GetName(id), GetName(playerid));
- SendClientMessageToAll(COLOR_WHITE, string);
- format(PlayerInfo[playerid][pPropose], 256, GetName(id));
- format(PlayerInfo[id][pPropose], 256, GetName(playerid));
- new query[256];
- format(query, sizeof(query), "UPDATE `users` SET `Propose`='%s' WHERE `ID`='%d'", PlayerInfo[playerid][pPropose], PlayerInfo[playerid][pSQLID]);
- mysql_query(SQL, query);
- format(query, sizeof(query), "UPDATE `users` SET `Propose`='%s' WHERE `ID`='%d'", PlayerInfo[id][pPropose], PlayerInfo[id][pSQLID]);
- mysql_query(SQL, query);
- finishAchievement(playerid, 17);
- finishAchievement(id, 17);
- return 1;
- }
- else if(strcmp(x_job,"clan",true) == 0) {
- if(GetPVarInt(playerid, "OfferedClan") == -1 || GetPVarInt(playerid, "OfferedClan") != id) return SCM(playerid, COLOR_GREY, "Acel player nu ti-a facut o oferta!");
- if(PlayerInfo[playerid][pClan] != 0) return SCM(playerid, COLOR_GREY, "Esti deja intr-un clan. Foloseste comanda /quitclan pentru a iesi din clanul in care esti acum!");
- new
- clan = GetPVarInt(playerid, "SellClan"),
- money = GetPVarInt(playerid, "ClanMoney");
- if(PlayerInfo[id][pClan] != clan || PlayerInfo[id][pClanRank] < 6) return SCM(playerid, COLOR_GREY, "Acel player nu mai detine clanul care ti l-a oferit!");
- if(GetPlayerCash(playerid) < money) return SCM(playerid, COLOR_GREY, "Nu ai suma necesara pentru a accepta oferta!");
- format(string, sizeof(string), "%s ti-a acceptat oferta de a lua clanul si ai primit $%s.", GetName(playerid), FormatNumber(money));
- SCM(id, COLOR_MONEY, string);
- format(string, sizeof(string), "Ai acceptat oferta lui %s si ai pierdut $%s.", GetName(id), FormatNumber(money));
- SCM(playerid, COLOR_MONEY, string);
- GivePlayerCash(playerid, -money);
- GivePlayerCash(id, money);
- PlayerInfo[playerid][pClan] = clan;
- PlayerInfo[playerid][pClanRank] = 6;
- UpdateVar(playerid, "Clan", clan); UpdateVar(playerid, "ClanRank", 6); UpdateVar(playerid, "ClanDays", 0);
- PlayerInfo[id][pClan] = 0;
- PlayerInfo[id][pClanRank] = 0;
- UpdateVar(id, "Clan", 0); UpdateVar(id, "ClanRank", 0); UpdateVar(id, "ClanDays", 0);
- format(string, sizeof(string), "[CLAN] %s este noul lider al clanului!", GetName(playerid));
- SendClanMessage(clan, string);
- DeletePVar(playerid, "OfferedClan");
- DeletePVar(playerid, "ClanMoney");
- DeletePVar(playerid, "SellClan");
- new query[128];
- format(query, 128, "UPDATE `clans` SET `Owner`='%s', `OwnerSQL`='%d' WHERE `ID`='%d'", GetName(playerid), PlayerInfo[playerid][pSQLID], clan);
- mysql_query(SQL, query);
- new szName[180];
- SetPlayerName(id, PlayerInfo[id][pUsername]);
- PlayerInfo[playerid][pTag] = 0;
- format(szName, sizeof(szName), "%s%s", ClanInfo[clan][clTag], PlayerInfo[playerid][pUsername]);
- SetPlayerName(playerid, szName);
- return 1;
- }
- if(strcmp(x_job,"Lesson",true) == 0) {
- new x = GetPVarInt(playerid, "Lesson");
- if(x == -1 || x != id) return SCM(playerid, -1, "Acel player nu ti-a facut o invitatie.");
- if(GetPVarInt(id, "InLesson") == 1) return SCM(playerid, -1, "Acel instructor are deja o lectie activa.");
- SetPVarInt(playerid, "InLesson", id);
- SetPVarInt(id, "InLesson", playerid);
- SetPVarInt(playerid, "Lesson", -1);
- format(string, sizeof(string), "**(( SI Dispatch: %s (%d) a inceput o lectie cu %s (%d). ))**", GetName(id), id, GetName(playerid), playerid);
- SendFactionMessage(PlayerInfo[id][pMember], COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "Ai acceptat lectia oferita de instructorul %s.", GetName(id));
- SCM(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "%s ti-a acceptat inceperea lectiei cu tine.", GetName(playerid));
- SCM(id, COLOR_LIGHTBLUE, string);
- return 1;
- }
Add Comment
Please, Sign In to add comment