Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // INCLUDES //
- /*
- Create by Janik22
- Date : 30.6.2020
- Time : 8:35
- Dont remove credits
- */
- #include a_samp
- #include sscanf
- #include zcmd
- #pragma tabsize 0
- // NEWS
- new aukce_weapon[150];
- new aukce_ammo[150];
- new aukce_cena[150];
- new aukce_kupuj[150];
- new aukce_prodej[150];
- new bool:aukce_bezi[150] = false;
- //==============================================================================
- new WeaponNames[][28] =
- {
- {"Nic"},
- {"Boxér"},
- {"Golfová hůl"},
- {"Obušek"},
- {"Nůž"},
- {"Baseballka"},
- {"Lopata"},
- {"Tágo"},
- {"Katana"},
- {"Motorová pila"},
- {"Dildo"},
- {"Dildo"},
- {"Vibrator"},
- {"Vibrator"},
- {"Květiny"},
- {"Hůl"},
- {"Granát"},
- {"Slzný plyn"},
- {"Molotov"},
- {" "},
- {" "},
- {" "},
- {"Colt 45"},
- {"Silenced 9 mm"},
- {"Desert Eagle"},
- {"Brokovnice"},
- {"Sawn-off-Shotgun"},
- {"Combat Shotgun"},
- {"Micro Uzi (Mac 10) "},
- {"MP5"},
- {"AK47"},
- {"M4"},
- {"Tec9"},
- {"Puska"},
- {"Sniperka"},
- {"RPG"},
- {"RPG"},
- {"flamethrower"},
- {"Minigun"},
- {"C4 trhavina"},
- {"Detonator"},
- {"Sprey"},
- {"Hasicak"},
- {"Fotoaparat"},
- {"Night vision"},
- {"Infrared vision"},
- {"parachute"},
- {" "}
- };
- public OnFilterScriptInit()
- {
- AntiDeAMX();
- return 1;
- }
- forward Aukce(playerid, cena);
- CMD:auction(playerid, params[])
- {
- new string[128];
- new cena,weapon,amm;
- if (sscanf(params, "ddd", cena,weapon,amm)) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} [ ! ]" " /auction [price] [id-weapon] [ammo]");
- if (weapon > 46) return SendClientMessage(playerid, 0xFF0000AA, "{ff0000}[ SERVER ]{ffffff} Špatně zadané ID zbraně!");
- if (weapon == 38 || weapon == 0 || weapon == 19 || weapon == 18 || weapon == 20) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} This weapon cannot be auctioned!");
- if (weapon != GetPlayerWeapon(playerid)) return SendClientMessage(playerid,-1, "{ff0000}[ SERVER ]{ffffff} You don't have this weapon!");
- if (amm > GetPlayerAmmo(playerid)) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} you dont have ammo!");
- if(aukce_bezi[playerid] == true) return SendClientMessage(playerid, 0xFF0000AA, "{ff0000}[ SERVER ]{ffffff} Only 1 auction per player is allowed!");
- aukce_weapon[playerid] = weapon;
- aukce_ammo[playerid] = amm;
- aukce_cena[playerid] = cena;
- aukce_bezi[playerid] = true;
- aukce_prodej[playerid] = playerid;
- format(string, sizeof string, "{00ff00}[ Auction ] Player {4169e1}%s(%d){00ff00} auctioning a weapon {4169e1}%s(%d){00ff00} Ammo, price {4169e1}$%d", Jmeno(playerid),playerid,WeaponName(weapon), amm, cena);
- SendClientMessageToAll(-1, string);
- SendClientMessageToAll(-1, "{00ff00}[ Auction ] You throw in the higher part {4169e1}/bid");
- SetTimerEx("Aukce", 60000, false, "ud", playerid, cena);
- return 1;
- }
- CMD:credits(playerid)
- {
- new DIALOG_CREDITS[2690];
- //--------------------------------------------------------------------------
- strcat(DIALOG_CREDITS, "{FFFFFF}[ {0000FF}Credits {FFFFFF}]:\n");
- strcat(DIALOG_CREDITS, "{ff1493}• {ffffff}Auction system create by Janik22: {00FF00}/credits\n");
- strcat(DIALOG_CREDITS, "{ff1493}• {FFFFFF}Please dont remove credits /credits\n");
- strcat(DIALOG_CREDITS, "{ff1493}• {FFFFFF}Create by Slovakia boss /credits\n");
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Credits (30.6.2020)(08:35)", DIALOG_CREDITS, "cancel", "");
- return 1;
- }
- CMD:bid(playerid, params[])
- {
- new ID, cena;
- if(sscanf(params, "dd", ID, cena)) return SendClientMessage(playerid, 1, "{ff0000}[ SERVER ]{ffffff} [ ! ]" " /bid [id-player] [amount]");
- if(strval(params) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 1, "{ff0000}[ SERVER ]{ffffff} You don't have enough money!");
- if(aukce_bezi[ID] == false) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} This player is not expensive!");
- if(aukce_prodej[ID] == playerid) return SendClientMessage(playerid, -1, "{ff0000}[ SERVER ]{ffffff} It is not possible to bid on your auction!");
- if(aukce_cena[ID] < cena)
- {
- aukce_cena[ID] = cena;
- aukce_kupuj[ID] = playerid;
- new string[128];
- format(string, sizeof string, "{00ff00}[ Auction ] Hráč {4169e1}%s(%d) {00ff00}has bidden {4169e1}%d${00ff00} at the player's auction {4169e1}%s {00ff00}about a gun {4169e1}%s", Jmeno(playerid),playerid, cena, Jmeno(ID), WeaponName(aukce_weapon[ID]));
- SendClientMessageToAll(-1, string);
- }
- else
- {
- new string[128];
- format(string, sizeof string, "{ff0000}Your amount cannot be less than {ffffff}%d", aukce_cena[ID]);
- SendClientMessage(playerid, -1, string);
- }
- return 1;
- }
- public Aukce(playerid, cena)
- {
- if(aukce_bezi[playerid] == true)
- {
- if(aukce_cena[playerid] > cena)
- {
- GivePlayerWeapon(aukce_kupuj[playerid], aukce_weapon[playerid], aukce_ammo[playerid]);
- GivePlayerWeapon(playerid, -aukce_weapon[playerid], -aukce_ammo[playerid]);
- GivePlayerMoney(aukce_kupuj[playerid], -aukce_cena[playerid]);
- GivePlayerMoney(playerid, aukce_cena[playerid]);
- new string[128];
- format(string, sizeof string, "{00ff00}[ Auction ] Player {4169e1}%s(%d) {00ff00}won the player's auction {4169e1}%s {00ff00}for {4169e1}%d$ {00ff00}about a gun {4169e1}%s", Jmeno(aukce_kupuj[playerid]),playerid, Jmeno(playerid), aukce_cena[playerid], WeaponName(aukce_weapon[playerid]));
- SendClientMessageToAll(-1, string);
- }
- else
- {
- new string[128];
- format(string, sizeof string, "{00ff00}[ Auction ] No one has bid on a player {4169e1}%s(%d)", Jmeno(playerid),playerid);
- SendClientMessageToAll(-1, string);
- }
- }
- aukce_weapon[playerid] = -1;
- aukce_ammo[playerid] = -1;
- aukce_bezi[playerid] = false;
- aukce_prodej[playerid] = -1;
- aukce_kupuj[playerid] = -1;
- aukce_cena[playerid] = -1;
- }
- Jmeno(playerid)
- {
- new n[24];
- GetPlayerName(playerid, n, sizeof n);
- return n;
- }
- WeaponName(weaponid)
- {
- return WeaponNames[weaponid];
- }
- AntiDeAMX()
- {
- new a[][] =
- {
- "Unarmed (Fist)",
- "Brass K"
- };
- #pragma unused a
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement