Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <YSI\y_ini>
- #include <YSI\y_iterate>
- #include <YSI\y_timers>
- #include <sscanf2>
- #include <streamer>
- #define MAX_SADNICA 150
- enum pInfo
- {
- pSeme,
- pNeobradjena,
- pDroga
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- enum MarInfo
- {
- mMarihuanaObjekatID,
- Text3D:mMarihuanaLabel,
- bool:mPosadjena,
- mMinutaPosadjeno,
- bool:mSpremnaBranje,
- mGrama,
- Float:mPozX,
- Float:mPozY,
- Float:mPozZ
- };
- new MarihuanaInfo[MAX_SADNICA][MarInfo];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- Create3DTextLabel("/kupiseme", -1, 1951.9841,1343.0011,15.3746, 40.0, 0, 0); //2355.7651, -647.1533, 128.0547 koordinate za balkanium
- Create3DTextLabel("Polje(1)", -1, 1963.2262,1374.5845,9.2578, 40.0, 0, 0); //887.5068, -19.3465, 63.3301 koordinate za balkanium
- Create3DTextLabel("Polje(2)", -1, 893.0886, -22.1127, 63.2500, 40.0, 0, 0);
- Create3DTextLabel("Polje(3)", -1, 890.8806, -28.0678, 63.2981, 40.0, 0, 0);
- Create3DTextLabel("Polje(4)", -1, 885.1781, -26.0521, 63.2499, 40.0, 0, 0);
- SetTimer("porukaha", 5000, false);
- return 1;
- }
- stock g_Marihuana_Posadi(playerid, Float:Poz_X, Float:Poz_Y, Float:Poz_Z)
- {
- new mar_id;
- if(mar_id == -1)
- {
- SendClientMessage(-1, playerid, "{ff0000}.:LW:AC:.{FFFFFF} Dogodila se greska sa kreiranem sadnice u stocku, PRIJAVITE OVO HEAD ADMINU!");
- return -1;
- }
- MarihuanaInfo[mar_id][mPozX] = Poz_X;
- MarihuanaInfo[mar_id][mPozY] = Poz_Y;
- MarihuanaInfo[mar_id][mPozZ] = Poz_Z-2;
- MarihuanaInfo[mar_id][mGrama] = 0;
- MarihuanaInfo[mar_id][mPosadjena] = true;
- MarihuanaInfo[mar_id][mMinutaPosadjeno] = 0;
- MarihuanaInfo[mar_id][mSpremnaBranje] = false;
- MarihuanaInfo[mar_id][mMarihuanaObjekatID] = CreateDynamicObject(3409,1963.2262, 1374.5845, 9.2578, 0.0, 0.0, 96, 0, -1, -1, 200.0);
- MarihuanaInfo[mar_id][mMarihuanaLabel] = CreateDynamic3DTextLabel("Marihuana\nNije spremna za branje\nKoristite tipku 'Y' za branje/unistvanje", 0x1D9F00AA, MarihuanaInfo[mar_id][mPozX], MarihuanaInfo[mar_id][mPozY], MarihuanaInfo[mar_id][mPozZ]+1.0, 10.0,_,_,_, 0, 0,_,_);
- PlayerPlaySound(playerid,2000,0,0,0);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 0, 0, 0, 0, 0, 1);
- new string[70];
- new GetName[MAX_PLAYER_NAME];
- format(string, sizeof(string), "* %s uzima semenke marihuane i sadi ih.", GetName);
- SendClientMessage(playerid, -1, string);
- SendClientMessage(playerid, -1, "Posadili ste marihuane i mozete je ubrati za 15 minuta!");
- SendClientMessage(playerid, -1, "BlaBlaBla!");
- return mar_id;
- }
- stock g_Marihuana_Unisti(mar_id)
- {
- DestroyDynamicObject(MarihuanaInfo[mar_id][mMarihuanaObjekatID]);
- DestroyDynamic3DTextLabel(MarihuanaInfo[mar_id][mMarihuanaLabel]);
- MarihuanaInfo[mar_id][mPozX] = 0;
- MarihuanaInfo[mar_id][mPozY] = 0;
- MarihuanaInfo[mar_id][mPozZ] = 0;
- MarihuanaInfo[mar_id][mGrama] = 0;
- MarihuanaInfo[mar_id][mMinutaPosadjeno] = 0;
- MarihuanaInfo[mar_id][mSpremnaBranje] = false;
- MarihuanaInfo[mar_id][mPosadjena] = false;
- return 1;
- }
- CMD:kupiseme(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1951.9841,1343.0011,15.3746))
- {
- new kolicina=0, str[64], strr[64];
- if(sscanf(params, "i", kolicina)) return SendClientMessage(playerid, -1, "/kupiseme [kolicina]");
- else
- {
- PlayerInfo[playerid][pSeme] += kolicina;
- format(str, sizeof(str), "Uzeli ste %d kolicine", kolicina);
- SendClientMessage(playerid, -1, str);
- format(strr, sizeof(strr), "Imate %d semena", PlayerInfo[pSeme]);
- SendClientMessage(playerid, -1, strr);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Nisi na pravom mestu");
- }
- return 1;
- }
- CMD:droga(playerid, params[])
- {
- new droga[64];
- format(droga, sizeof(droga), "Imate %d semena", PlayerInfo[pSeme]);
- SendClientMessage(playerid, -1, droga);
- return 1;
- }
- CMD:sadidrogu(playerid, params[])
- {
- new Float:x, Float:y, Float:z;
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1963.2262,1374.5845,9.2578))
- {
- if(PlayerInfo[playerid][pSeme] == 0) return SendClientMessage(playerid, -1, "Nemate seme za sadjenje");
- GetPlayerPos(playerid, x, y, z);
- g_Marihuana_Posadi(playerid, x, y, z);
- PlayerInfo[playerid][pSeme] --;
- }
- else
- {
- SendClientMessage(playerid, -1, "Nista na polju");
- }
- return 1;
- }
- CMD:uzmidrogu(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1963.2262,1374.5845,9.2578))
- {
- }
- else
- {
- SendClientMessage(playerid, -1, "Nista na polju");
- }
- return 1;
- }
- CMD:obradidrogu(playerid, params[])
- {
- return 1;
- }
- CMD:usedugs(playerid, params[])
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public porukaha()
- {
- new mar_id;
- MarihuanaInfo[mar_id][mMinutaPosadjeno] ++;
- }
- forward porukaha();
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_YES))
- {
- new string[80], mar_id;
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 1963.2262, 1374.5845, 9.2578))
- {
- //if(PlayerInfo[mMinutaPosadjeno])
- if(MarihuanaInfo[mar_id][mMinutaPosadjeno] == 5)
- {
- new Name[MAX_PLAYER_NAME];
- format(string, sizeof(string), "* %s se saginje i bere marihuanu.", Name);
- format(string, sizeof(string), "Ubrali ste %d grama marihuane.", MarihuanaInfo[mar_id][mGrama]);
- SendClientMessage(playerid, -1, string);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 6.0, 0, 0, 0, 0, 0, 1);
- new marihuana_sledeca;
- PlayerInfo[playerid][pNeobradjena] += 50;
- g_Marihuana_Unisti(mar_id);
- mar_id = marihuana_sledeca;
- }
- if(MarihuanaInfo[mar_id][mMinutaPosadjeno] != 0)
- {
- SendClientMessage(playerid, -1, "Nije jos vreme");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Niste na pravom mestu");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement