Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YCMD:kreirajvik(playerid,params[], help)
- {
- #pragma unused params
- #pragma unused help
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Samo admini!");
- new Sell, lvl, vrsta;
- if(sscanf(params, "iii", Sell, lvl , vrsta))
- {
- SendClientMessage(playerid, -1, "/kreirajvik [cena] [lvl] [vrsta]");
- return true;
- }
- if(Sell < 5000 || Sell > 50000) return SendClientMessage(playerid, -1, "Cena izmedju 5k i 50k");
- if(lvl < 2 || lvl > 12) return SendClientMessage(playerid, -1, "Level izmedju 2 i 12");
- if((NekoristeniIDVik()-1) >= Max_Vikendica) return SendClientMessage(playerid, -1, ""zuta" Vikendica:"zelena" Max vikendica postoji!");
- new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
- new sledeci = NekoristeniIDVik();
- format(fajlVikendice, sizeof(fajlVikendice), "/Vikendice/%d.json", sledeci);
- if(!fexist(fajlVikendice))
- {
- switch(vrsta)
- {
- case 1: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlVikendice);
- djSet(fajlVikendice, "Vlasnik", "DRZAVA");
- djSetInt(fajlVikendice, "Na_Prodaju", 1);
- djSetInt(fajlVikendice, "Cena", Sell);
- djSetInt(fajlVikendice, "Rent", 10);
- djSetInt(fajlVikendice, "Level", lvl);
- djSetFloat(fajlVikendice,"X", X);
- djSetFloat(fajlVikendice,"Y", Y);
- djSetFloat(fajlVikendice,"Z", Z);
- djSetInt(fajlVikendice, "VW", sledeci+1);
- djSetInt(fajlVikendice, "Zakljucana", 0);
- djSetFloat(fajlVikendice, "225.756989",2260.76);
- djSetFloat(fajlVikendice, "1240.000000",-1210.45);
- djSetFloat(fajlVikendice, "1082.149902",1049.02);
- djSetInt(fajlVikendice, "2",10);
- djAutocommit(true);
- UcitajVIkendice(sledeci);
- SendClientMessage(playerid, -1, " Vikendica napravljena!");
- }
- case 2: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlVikendice);
- djSet(fajlVikendice, "Vlasnik", "DRZAVA");
- djSetInt(fajlVikendice, "Na_Prodaju", 1);
- djSetInt(fajlVikendice, "Cena", Sell);
- djSetInt(fajlVikendice, "Rent", 10);
- djSetInt(fajlVikendice, "Level", lvl);
- djSetFloat(fajlVikendice,"X", X);
- djSetFloat(fajlVikendice,"Y", Y);
- djSetFloat(fajlVikendice,"Z", Z);
- djSetInt(fajlVikendice, "VW", sledeci+1);
- djSetInt(fajlVikendice, "Zakljucana", 0);
- djSetFloat(fajlVikendice, "328.493988",2260.76);
- djSetFloat(fajlVikendice, "1480.589966",-1210.45);
- djSetFloat(fajlVikendice, "1084.449951",1049.02);
- djSetInt(fajlVikendice, "15",10);
- djAutocommit(true);
- UcitajVIkendice(sledeci);
- SendClientMessage(playerid, -1, " Vikendica napravljena!");
- }
- case 3: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlVikendice);
- djSet(fajlVikendice, "Vlasnik", "DRZAVA");
- djSetInt(fajlVikendice, "Na_Prodaju", 1);
- djSetInt(fajlVikendice, "Cena", Sell);
- djSetInt(fajlVikendice, "Rent", 10);
- djSetInt(fajlVikendice, "Level", lvl);
- djSetFloat(fajlVikendice,"X", X);
- djSetFloat(fajlVikendice,"Y", Y);
- djSetFloat(fajlVikendice,"Z", Z);
- djSetInt(fajlVikendice, "VW", sledeci+1);
- djSetInt(fajlVikendice, "Zakljucana", 0);
- djSetFloat(fajlVikendice, "223.043991",2260.76);
- djSetFloat(fajlVikendice, "1289.259888",-1210.45);
- djSetFloat(fajlVikendice, "1082.199951",1049.02);
- djSetInt(fajlVikendice, "1",10);
- djAutocommit(true);
- UcitajVIkendice(sledeci);
- SendClientMessage(playerid, -1, " Vikendica napravljena!");
- }
- case 4: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlVikendice);
- djSet(fajlVikendice, "Vlasnik", "DRZAVA");
- djSetInt(fajlVikendice, "Na_Prodaju", 1);
- djSetInt(fajlVikendice, "Cena", Sell);
- djSetInt(fajlVikendice, "Rent", 10);
- djSetInt(fajlVikendice, "Level", lvl);
- djSetFloat(fajlVikendice,"X", X);
- djSetFloat(fajlVikendice,"Y", Y);
- djSetFloat(fajlVikendice,"Z", Z);
- djSetInt(fajlVikendice, "VW", sledeci+1);
- djSetInt(fajlVikendice, "Zakljucana", 0);
- djSetFloat(fajlVikendice, "385.803986",2260.76);
- djSetFloat(fajlVikendice, "1471.769897",-1210.45);
- djSetFloat(fajlVikendice, "1080.209961",1049.02);
- djSetInt(fajlVikendice, "15",10);
- djAutocommit(true);
- UcitajVIkendice(sledeci);
- SendClientMessage(playerid, -1, " Vikendica napravljena!");
- }
- }
- }
- return true;
- }
- YCMD:kreirajstan(playerid,params[], help)
- {
- #pragma unused params
- #pragma unused help
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Samo admini!");
- new Sell, lvl, vrsta;
- if(sscanf(params, "iii", Sell, lvl , vrsta))
- {
- SendClientMessage(playerid, -1, "[USAGE]: /kreirajstan [cena] [lvl] [vrsta]");
- return true;
- }
- if(Sell < 5000 || Sell > 50000) return SendClientMessage(playerid, -1, "Cena izmedju 5k i 50k!");
- if(lvl < 2 || lvl > 12) return SendClientMessage(playerid, -1, "Level izmedju 2 i 12!");
- if((NekoristeniIDStana()-1) >= Max_Stanova) return SendClientMessage(playerid, -1, ""zuta" Stan:"zelena" Max stanova postoji.");
- new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
- new sledeci = NekoristeniIDStana();
- format(fajlstana, sizeof(fajlstana), "/Stanovi/%d.json", sledeci);
- if(!fexist(fajlstana))
- {
- switch(vrsta)
- {
- case 1: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlstana);
- djSet(fajlstana, "Vlasnik", "DRZAVA");
- djSetInt(fajlstana, "Na_Prodaju", 1);
- djSetInt(fajlstana, "Cena", Sell);
- djSetInt(fajlstana, "Rent", 10);
- djSetInt(fajlstana, "Level", lvl);
- djSetFloat(fajlstana,"X", X);
- djSetFloat(fajlstana,"Y", Y);
- djSetFloat(fajlstana,"Z", Z);
- djSetInt(fajlstana, "VW", sledeci+1);
- djSetInt(fajlstana, "Zakljucana", 0);
- djSetFloat(fajlstana, "1523.509887",2260.76);
- djSetFloat(fajlstana, "-47.821197",-1210.45);
- djSetFloat(fajlstana, "1002.130981",1049.02);
- djSetInt(fajlstana, "2",10);
- djAutocommit(true);
- UcitajStanove(sledeci);
- SendClientMessage(playerid, -1, " Stan napravljen!");
- }
- case 2: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlstana);
- djSet(fajlstana, "Vlasnik", "DRZAVA");
- djSetInt(fajlstana, "Na_Prodaju", 1);
- djSetInt(fajlstana, "Cena", Sell);
- djSetInt(fajlstana, "Rent", 10);
- djSetInt(fajlstana, "Level", lvl);
- djSetFloat(fajlstana,"X", X);
- djSetFloat(fajlstana,"Y", Y);
- djSetFloat(fajlstana,"Z", Z);
- djSetInt(fajlstana, "VW", sledeci+1);
- djSetInt(fajlstana, "Zakljucana", 0);
- djSetFloat(fajlstana, "1527.229980",2260.76);
- djSetFloat(fajlstana, "-11.574499",-1210.45);
- djSetFloat(fajlstana, "1002.097106",1049.02);
- djSetInt(fajlstana, "3",10);
- djAutocommit(true);
- UcitajStanove(sledeci);
- SendClientMessage(playerid, -1, " Stan napravljen!");
- }
- case 3: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlstana);
- djSet(fajlstana, "Vlasnik", "DRZAVA");
- djSetInt(fajlstana, "Na_Prodaju", 1);
- djSetInt(fajlstana, "Cena", Sell);
- djSetInt(fajlstana, "Rent", 10);
- djSetInt(fajlstana, "Level", lvl);
- djSetFloat(fajlstana,"X", X);
- djSetFloat(fajlstana,"Y", Y);
- djSetFloat(fajlstana,"Z", Z);
- djSetInt(fajlstana, "VW", sledeci+1);
- djSetInt(fajlstana, "Zakljucana", 0);
- djSetFloat(fajlstana, "271.884979",2260.76);
- djSetFloat(fajlstana, "306.631988",-1210.45);
- djSetFloat(fajlstana, "999.148437",1049.02);
- djSetInt(fajlstana, "2",10);
- djAutocommit(true);
- UcitajStanove(sledeci);
- SendClientMessage(playerid, -1, " Stan napravljen!");
- }
- case 4: // Small/1 story/1 bedroom
- {
- djCreateFile(fajlstana);
- djSet(fajlstana, "Vlasnik", "DRZAVA");
- djSetInt(fajlstana, "Na_Prodaju", 1);
- djSetInt(fajlstana, "Cena", Sell);
- djSetInt(fajlstana, "Rent", 10);
- djSetInt(fajlstana, "Level", lvl);
- djSetFloat(fajlstana,"X", X);
- djSetFloat(fajlstana,"Y", Y);
- djSetFloat(fajlstana,"Z", Z);
- djSetInt(fajlstana, "VW", sledeci+1);
- djSetInt(fajlstana, "Zakljucana", 0);
- djSetFloat(fajlstana, "2807.619873",2260.76);
- djSetFloat(fajlstana, "-1171.899902",-1210.45);
- djSetFloat(fajlstana, "1025.570312",1049.02);
- djSetInt(fajlstana, "8",10);
- djAutocommit(true);
- UcitajStanove(sledeci);
- SendClientMessage(playerid, -1, " Stan napravljen!");
- }
- }
- }
- return true;
- }
Add Comment
Please, Sign In to add comment