SHARE
TWEET

Untitled

a guest Mar 26th, 2020 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. YCMD:setstat(playerid, params[], help) {
  2.     new valoare, item[50], userid, id[64], query[256], string[180];
  3.     if(PlayerInfo[playerid][pAdmin] < 7) return 1;
  4.     if(sscanf(params, "s[64]s[50]i", id, item, valoare)) {
  5.         SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setstat <full name/id> <item> <amount>");
  6.         SCM(playerid, COLOR_LGREEN, "Level, Money, Bank, House, Bizz, Job, Hours, Premium, premiumpoints");
  7.         SCM(playerid, COLOR_LGREEN, "Rob, Mats, Drugs, Member, Leader, Rank, Fwarn, Warn, FPunish, Phone.");
  8.         SCM(playerid, COLOR_LGREEN, "Slot1-10, Vip, Clan, ClanRank, Admin, Helper,SpinPoints");
  9.         return 1;
  10.     }  
  11.     if(IsNumeric(id)) {
  12.         if(IsPlayerConnected(strval(id))) {
  13.             //format(id, 64, "%s" GetName(id));
  14.         }  
  15.         else SCM(playerid, COLOR_GREY, "Player not connected!");
  16.     }
  17.     new cont = MySQLCheckAccount(id);
  18.     if(cont == 0) return SCM(playerid, COLOR_GREY, "Acest nume nu a fost gasit in baza de date!");
  19.     userid = GetPlayerID(id);
  20.     if(strcmp(item, "level", true) == 0) {
  21.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pLevel] = valoare, SetPlayerScore(userid, valoare), UpdateProgress(playerid, 0);
  22.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET `Level`='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  23.         mysql_tquery(SQL, string, "", "");
  24.     }      
  25.     else if(strcmp(item, "slot1", true) == 0) {
  26.         if(userid != INVALID_PLAYER_ID) {
  27.             PlayerInfo[userid][pCarKey][0] = valoare;
  28.             if(valoare > 0) {
  29.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  30.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  31.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  32.                 mysql_query(SQL, query);
  33.             }  
  34.         }
  35.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey1='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  36.         mysql_tquery(SQL, string, "", "");
  37.     }
  38.     else if(strcmp(item, "slot2", true) == 0) {
  39.         if(userid != INVALID_PLAYER_ID) {
  40.             PlayerInfo[userid][pCarKey][1] = valoare;
  41.             if(valoare > 0) {
  42.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  43.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  44.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  45.                 mysql_query(SQL, query);
  46.             }              
  47.         }                      
  48.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey2='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  49.         mysql_tquery(SQL, string, "", "");
  50.     }
  51.     else if(strcmp(item, "slot3", true) == 0) {
  52.         if(userid != INVALID_PLAYER_ID) {
  53.             PlayerInfo[userid][pCarKey][2] = valoare;
  54.             if(valoare > 0) {
  55.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  56.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  57.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  58.                 mysql_query(SQL, query);
  59.             }  
  60.         }  
  61.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey3='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  62.         mysql_tquery(SQL, string, "", "");
  63.     }
  64.     else if(strcmp(item, "slot4", true) == 0) {
  65.         if(userid != INVALID_PLAYER_ID) {
  66.             PlayerInfo[userid][pCarKey][3] = valoare;
  67.             if(valoare > 0) {
  68.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  69.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  70.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  71.                 mysql_query(SQL, query);
  72.             }  
  73.         }  
  74.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey4='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  75.         mysql_tquery(SQL, string, "", "");
  76.     }
  77.     else if(strcmp(item, "slot5", true) == 0) {
  78.         if(userid != INVALID_PLAYER_ID) {
  79.             PlayerInfo[userid][pCarKey][4] = valoare;
  80.             if(valoare > 0) {
  81.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  82.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  83.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  84.                 mysql_query(SQL, query);
  85.             }  
  86.         }  
  87.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey5='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  88.         mysql_tquery(SQL, string, "", "");
  89.     }
  90.     else if(strcmp(item, "slot6", true) == 0) {
  91.         if(userid != INVALID_PLAYER_ID) {
  92.             PlayerInfo[userid][pCarKey][5] = valoare;
  93.             if(valoare > 0) {
  94.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  95.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  96.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  97.                 mysql_query(SQL, query);
  98.             }  
  99.         }
  100.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey6='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  101.         mysql_tquery(SQL, string, "", "");
  102.     }  
  103.     else if(strcmp(item, "slot7", true) == 0) {
  104.         if(userid != INVALID_PLAYER_ID) {
  105.             PlayerInfo[userid][pCarKey][6] = valoare;
  106.             if(valoare > 0) {
  107.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  108.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  109.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  110.                 mysql_query(SQL, query);
  111.             }  
  112.         }  
  113.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey7='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  114.         mysql_tquery(SQL, string, "", "");
  115.     }
  116.     else if(strcmp(item, "slot8", true) == 0) {
  117.         if(userid != INVALID_PLAYER_ID) {
  118.             PlayerInfo[userid][pCarKey][7] = valoare;
  119.             if(valoare > 0) {
  120.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  121.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  122.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  123.                 mysql_query(SQL, query);
  124.             }  
  125.         }
  126.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey8='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  127.         mysql_tquery(SQL, string, "", "");
  128.     }
  129.     else if(strcmp(item, "slot9", true) == 0) {
  130.         if(userid != INVALID_PLAYER_ID) {
  131.             PlayerInfo[userid][pCarKey][8] = valoare;
  132.             if(valoare > 0) {
  133.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  134.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  135.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  136.                 mysql_query(SQL, query);
  137.             }  
  138.         }  
  139.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey9='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  140.         mysql_tquery(SQL, string, "", "");
  141.     }  
  142.     else if(strcmp(item, "slot10", true) == 0) {
  143.         if(userid != INVALID_PLAYER_ID) {
  144.             PlayerInfo[userid][pCarKey][9] = valoare;
  145.             if(valoare > 0) {
  146.                 format(CarInfo[valoare][cOwner], 256, GetName(userid));
  147.                 CarInfo[valoare][Userid] = PlayerInfo[userid][pSQLID]; 
  148.                 format(query, sizeof(query), "UPDATE `cars` SET `Userid`='%d', `Name`='%s' WHERE `ID`='%d'", PlayerInfo[userid][pSQLID], GetName(userid), PlayerInfo[userid][pCarKey][0]);
  149.                 mysql_query(SQL, query);
  150.             }  
  151.         }
  152.         mysql_format(SQL, string, sizeof(string), "UPDATE users SET CarKey10='%d' WHERE `name`='%s' LIMIT 1", valoare, id);
  153.         mysql_tquery(SQL, string, "", "");
  154.     }
  155.     else if(strcmp(item, "admin", true) == 0) {
  156.         if(valoare < 0 || valoare > 6) return SCM(playerid, COLOR_GREY, "Invalid admin level! (0-6)");
  157.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pAdmin] = valoare;      
  158.         format(query, sizeof(query), "UPDATE `users` SET `Admin`='%d' WHERE `name`='%s'", valoare, id);
  159.         mysql_query(SQL, query);
  160.     }  
  161.     else if(strcmp(item, "helper", true) == 0) {
  162.         if(valoare < 0 || valoare > 3) return SCM(playerid, COLOR_GREY, "Invalid helper level! (0-3)");
  163.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pHelper] = valoare;
  164.         format(query, sizeof(query), "UPDATE `users` SET `Helper`='%d' WHERE `name`='%s'", valoare, id);
  165.         mysql_query(SQL, query);
  166.     }      
  167.     else if(strcmp(item, "money", true) == 0) {
  168.         if(userid != INVALID_PLAYER_ID) Cash[userid] = valoare;
  169.         format(query, sizeof(query), "UPDATE `users` SET `Money`='%d' WHERE `name`='%s'", valoare, id);
  170.         mysql_query(SQL, query);
  171.     }
  172.     else if(strcmp(item, "bank", true) == 0) {
  173.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pAccount] = valoare;
  174.         format(query, sizeof(query), "UPDATE `users` SET `Bank`='%d' WHERE `name`='%s'", valoare, id);
  175.         mysql_query(SQL, query);
  176.     }
  177.     else if(strcmp(item, "house", true) == 0) {
  178.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pHouse] = valoare;
  179.         format(query, sizeof(query), "UPDATE `users` SET `House`='%d' WHERE `name`='%s'", valoare, id);
  180.         mysql_query(SQL, query);
  181.     }
  182.     else if(strcmp(item, "bizz", true) == 0) {
  183.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pBizz] = valoare;
  184.         format(query, sizeof(query), "UPDATE `users` SET `Bizz`='%d' WHERE `name`='%s'", valoare, id);
  185.         mysql_query(SQL, query);
  186.     }
  187.     else if(strcmp(item, "job", true) == 0) {
  188.         PlayerInfo[userid][pJob] = valoare;
  189.         format(query, sizeof(query), "UPDATE `users` SET `Job`='%d' WHERE `name`='%s'", valoare, id);
  190.         mysql_query(SQL, query);
  191.     }
  192.     else if(strcmp(item, "hours", true) == 0) {
  193.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pConnectTime] = valoare;
  194.         format(query, sizeof(query), "UPDATE `users` SET `ConnectedTime`='%0.3f' WHERE `name`='%s'", valoare, id);
  195.         mysql_query(SQL, query);   
  196.     }
  197.     else if(strcmp(item, "premium", true) == 0) {
  198.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pPremiumAccount] = valoare;
  199.         format(query, sizeof(query), "UPDATE `users` SET `Premium`='%d' WHERE `name`='%s'", valoare, id);
  200.         mysql_query(SQL, query);           
  201.     }  
  202.     else if(strcmp(item, "premiumpoints", true) == 0) {
  203.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pPremiumPoints] = valoare;
  204.         format(query, sizeof(query), "UPDATE `users` SET `GoldPoints`='%d' WHERE `name`='%s'", valoare, id);
  205.         mysql_query(SQL, query);       
  206.     }
  207.     else if(strcmp(item, "rob", true) == 0) {
  208.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pRob] = valoare;
  209.         format(query, sizeof(query), "UPDATE `users` SET `GoldCastigat`='%d' WHERE `name`='%s'", valoare, id);
  210.         mysql_query(SQL, query);       
  211.     }
  212.     else if(strcmp(item, "mats", true) == 0) {
  213.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pMats] = valoare;   
  214.         format(query, sizeof(query), "UPDATE `users` SET `Materials`='%d' WHERE `name`='%s'", valoare, id);
  215.         mysql_query(SQL, query);   
  216.     }      
  217.     else if(strcmp(item, "drugs", true) == 0) {
  218.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pDrugs] = valoare;  
  219.         format(query, sizeof(query), "UPDATE `users` SET `Drugs`='%d' WHERE `name`='%s'", valoare, id);
  220.         mysql_query(SQL, query);   
  221.     }      
  222.     else if(strcmp(item, "member", true) == 0) {
  223.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pMember] = valoare, SetPlayerToTeamColor(userid);   
  224.         format(query, sizeof(query), "UPDATE `users` SET `Member`='%d' WHERE `name`='%s'", valoare, id);
  225.         mysql_query(SQL, query);   
  226.     }  
  227.     else if(strcmp(item, "leader", true) == 0) {
  228.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pLeader] = valoare, SetPlayerToTeamColor(userid);   
  229.         format(query, sizeof(query), "UPDATE `users` SET `Leader`='%d' WHERE `name`='%s'", valoare, id);
  230.         mysql_query(SQL, query);   
  231.     }      
  232.     else if(strcmp(item, "rank", true) == 0) {
  233.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pRank] = valoare;   
  234.         format(query, sizeof(query), "UPDATE `users` SET `Rank`='%d' WHERE `name`='%s'", valoare, id);
  235.         mysql_query(SQL, query);   
  236.     }      
  237.     else if(strcmp(item, "fwarn", true) == 0) {
  238.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pFACWarns] = valoare;   
  239.         format(query, sizeof(query), "UPDATE `users` SET `FWarn`='%d' WHERE `name`='%s'", valoare, id);
  240.         mysql_query(SQL, query);   
  241.     }      
  242.     else if(strcmp(item, "warn", true) == 0) {
  243.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pWarns] = valoare;  
  244.         format(query, sizeof(query), "UPDATE `users` SET `Warnings`='%d' WHERE `name`='%s'", valoare, id);
  245.         mysql_query(SQL, query);   
  246.     }      
  247.     else if(strcmp(item, "fpunish", true) == 0) {
  248.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pFpunish] = valoare;
  249.         format(query, sizeof(query), "UPDATE `users` SET `FPunish`='%d' WHERE `name`='%s'", valoare, id);
  250.         mysql_query(SQL, query);   
  251.     }          
  252.     else if(strcmp(item, "phone", true) == 0) {
  253.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pPhone] = valoare;
  254.         format(query, sizeof(query), "UPDATE `users` SET `PhoneNr`='%d' WHERE `name`='%s'", valoare, id);
  255.         mysql_query(SQL, query);   
  256.     }
  257.     else if(strcmp(item, "vip", true) == 0) {
  258.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pVip] = valoare;
  259.         format(query, sizeof(query), "UPDATE `users` SET `Vip`='%d' WHERE `name`='%s'", valoare, id);
  260.         mysql_query(SQL, query);   
  261.     }
  262.     else if(strcmp(item, "clan", true) == 0) {
  263.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pClan] = valoare;   
  264.         format(query, sizeof(query), "UPDATE `users` SET `Clan`='%d' WHERE `name`='%s'", valoare, id);
  265.         mysql_query(SQL, query);   
  266.     }      
  267.     else if(strcmp(item, "clanrank", true) == 0) {
  268.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pClanRank] = valoare;   
  269.         format(query, sizeof(query), "UPDATE `users` SET `ClanRank`='%d' WHERE `name`='%s'", valoare, id);
  270.         mysql_query(SQL, query);   
  271.     }
  272.     else if(strcmp(item, "spinpoints", true) == 0) {
  273.         if(userid != INVALID_PLAYER_ID) PlayerInfo[userid][pSpinPoints] = valoare;
  274.         format(query, sizeof(query), "UPDATE `users` SET `SpinPoints`='%d' WHERE `name`='%s'", valoare, id);
  275.         mysql_query(SQL, query);       
  276.     }
  277.     else {
  278.         SCM(playerid, COLOR_WHITE, "Level, Money, Bank, House, Bizz, Job, Hours, Premium, premiumpoints.");
  279.         SCM(playerid, COLOR_WHITE, "Rob, Mats, Drugs, Member, Leader, Rank, Fwarn, Warn, FPunish, Phone.");
  280.         SCM(playerid, COLOR_WHITE, "Slot1-10, Vip, Clan, ClanRank, Admin, Helper, SpinPoints");
  281.         return 1;
  282.     }
  283.     if(userid != INVALID_PLAYER_ID) format(string, sizeof(string), "Warning: %s's %s was set to %d by admin %s.", GetName(userid), item, valoare, GetName(playerid));  
  284.     else format(string, sizeof(string), "Warning: %s's %s was set to %d by admin %s.", id, item, valoare, GetName(playerid));
  285.     SendAdminMessage(COLOR_LIGHTRED, string, 6);
  286.     return 1;
  287. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top