Guest User

Untitled

a guest
Jun 16th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.64 KB | None | 0 0
  1. YCMD:accept(playerid, params[], help) {
  2.     if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) {
  3.          SendClientMessage(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda deoarece nu te-ai autentificat cu codul de securitate.");
  4.          SendClientMessage(playerid, COLOR_GREY, "Pentru a te autentifica, foloseste comanda '/loginpin'!");
  5.          return 1;
  6.     }  
  7.     new x_job[180],id,sendername[25],giveplayer[25],string[500];
  8.     if(sscanf(params, "s[180]u",x_job,id))
  9.     {
  10.         SendClientMessage(playerid, COLOR_GREY, "USAGE: {FFFFFF}/accept <item> <playerid/name>");
  11.         SendClientMessage(playerid, COLOR_WHITE, "Trade, Dice, Drugs, Repair, Materials,");
  12.         SCM(playerid, -1, "Live, Free, Ticket, Refill, Invite, Lesson, Cinvite, Clan, Propose.");
  13.         return 1;
  14.     }
  15.     if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat.");
  16.     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!");
  17.     if(strcmp(x_job,"propose",true) == 0) {
  18.         if(GetPVarInt(playerid, "proposeID") != id) return SCM(playerid, COLOR_GREY, "Acel player nu ti-a facut o cerere!");
  19.         if(strcmp(PlayerInfo[playerid][pPropose], "Nimeni", true) == 0) { }
  20.         else return SCM(playerid, COLOR_LGREEN, "Eroare: Esti deja casatorit(a)!");        
  21.    
  22.         if(PlayerInfo[playerid][pSex] == PlayerInfo[id][pSex]) {
  23.             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));
  24.             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));
  25.         }
  26.         else  format(string, sizeof(string), "Avem un nou cuplu de indragostiti, %s si %s s-au casatorit.", GetName(id), GetName(playerid));
  27.         SendClientMessageToAll(COLOR_WHITE, string);
  28.        
  29.         format(PlayerInfo[playerid][pPropose], 256, GetName(id));
  30.         format(PlayerInfo[id][pPropose], 256, GetName(playerid));
  31.         new query[256];
  32.         format(query, sizeof(query), "UPDATE `users` SET `Propose`='%s' WHERE `ID`='%d'", PlayerInfo[playerid][pPropose], PlayerInfo[playerid][pSQLID]);
  33.         mysql_query(SQL, query);   
  34.         format(query, sizeof(query), "UPDATE `users` SET `Propose`='%s' WHERE `ID`='%d'", PlayerInfo[id][pPropose], PlayerInfo[id][pSQLID]);
  35.         mysql_query(SQL, query);
  36.         finishAchievement(playerid, 17);
  37.         finishAchievement(id, 17);     
  38.         return 1;
  39.     }          
  40.     else if(strcmp(x_job,"clan",true) == 0) {
  41.         if(GetPVarInt(playerid, "OfferedClan") == -1 || GetPVarInt(playerid, "OfferedClan") != id) return SCM(playerid, COLOR_GREY, "Acel player nu ti-a facut o oferta!");
  42.         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!");
  43.         new
  44.             clan = GetPVarInt(playerid, "SellClan"),
  45.             money = GetPVarInt(playerid, "ClanMoney");
  46.         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!");
  47.         if(GetPlayerCash(playerid) < money) return SCM(playerid, COLOR_GREY, "Nu ai suma necesara pentru a accepta oferta!");
  48.         format(string, sizeof(string), "%s ti-a acceptat oferta de a lua clanul si ai primit $%s.", GetName(playerid), FormatNumber(money));
  49.         SCM(id, COLOR_MONEY, string);
  50.         format(string, sizeof(string), "Ai acceptat oferta lui %s si ai pierdut $%s.", GetName(id), FormatNumber(money));
  51.         SCM(playerid, COLOR_MONEY, string);
  52.         GivePlayerCash(playerid, -money);
  53.         GivePlayerCash(id, money);
  54.         PlayerInfo[playerid][pClan] = clan;
  55.         PlayerInfo[playerid][pClanRank] = 6;
  56.         UpdateVar(playerid, "Clan", clan); UpdateVar(playerid, "ClanRank", 6); UpdateVar(playerid, "ClanDays", 0);
  57.         PlayerInfo[id][pClan] = 0;
  58.         PlayerInfo[id][pClanRank] = 0;
  59.         UpdateVar(id, "Clan", 0); UpdateVar(id, "ClanRank", 0); UpdateVar(id, "ClanDays", 0);
  60.         format(string, sizeof(string), "[CLAN] %s este noul lider al clanului!", GetName(playerid));
  61.         SendClanMessage(clan, string);
  62.         DeletePVar(playerid, "OfferedClan");
  63.         DeletePVar(playerid, "ClanMoney");
  64.         DeletePVar(playerid, "SellClan");
  65.         new query[128];
  66.         format(query, 128, "UPDATE `clans` SET `Owner`='%s', `OwnerSQL`='%d' WHERE `ID`='%d'", GetName(playerid), PlayerInfo[playerid][pSQLID], clan);
  67.         mysql_query(SQL, query);
  68.        
  69.         new szName[180];
  70.         SetPlayerName(id, PlayerInfo[id][pUsername]);
  71.         PlayerInfo[playerid][pTag] = 0;
  72.         format(szName, sizeof(szName), "%s%s", ClanInfo[clan][clTag], PlayerInfo[playerid][pUsername]);        
  73.         SetPlayerName(playerid, szName);       
  74.         return 1;
  75.     }  
  76.     if(strcmp(x_job,"Lesson",true) == 0) {
  77.         new x = GetPVarInt(playerid, "Lesson");
  78.         if(x == -1 || x != id) return SCM(playerid, -1, "Acel player nu ti-a facut o invitatie.");
  79.         if(GetPVarInt(id, "InLesson") == 1) return SCM(playerid, -1, "Acel instructor are deja o lectie activa.");
  80.         SetPVarInt(playerid, "InLesson", id);
  81.         SetPVarInt(id, "InLesson", playerid);
  82.         SetPVarInt(playerid, "Lesson", -1);
  83.         format(string, sizeof(string), "**(( SI Dispatch: %s (%d) a inceput o lectie cu %s (%d). ))**", GetName(id), id, GetName(playerid), playerid);
  84.         SendFactionMessage(PlayerInfo[id][pMember], COLOR_LIGHTBLUE, string);
  85.         format(string, sizeof(string), "Ai acceptat lectia oferita de instructorul %s.", GetName(id));
  86.         SCM(playerid, COLOR_LIGHTBLUE, string);
  87.         format(string, sizeof(string), "%s ti-a acceptat inceperea lectiei cu tine.", GetName(playerid));
  88.         SCM(id, COLOR_LIGHTBLUE, string);          
  89.         return 1;
  90.     }
Add Comment
Please, Sign In to add comment