Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Create your garden
- */
- #define lwa9t 1
- #define COLOR_RED 0xAA3333AA
- #include <a_samp>
- #include <zcmd>
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Agriculture System By Dark Light");
- print("--------------------------------------\n");
- return 1;
- }
- enum pInfo
- {
- fla7,
- flwe,
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new lbs[MAX_PLAYERS];
- new nbta[MAX_OBJECTS];
- new ch7al;
- new ztmr;
- new flbs;
- new Float:PX, Float:PY, Float:PZ ,Float:a;
- new lvl;
- new l7ba;
- new error;
- forward lbss(playerid);
- public lbss(playerid)
- {
- lvl += lwa9t;
- error =1;
- if(lvl == 5)
- {
- l7ba =677 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- }
- if(lvl == 10)
- {
- l7ba =678 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- }
- if(lvl == 15)
- {
- l7ba =679 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- }
- if(lvl == 20)
- {
- l7ba =681 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- }
- if(lvl == 25)
- {
- l7ba =680 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- KillTimer(lbs[playerid]);
- lvl = 0;
- error =0;
- }
- return true;
- }
- forward flw(playerid);
- public flw(playerid)
- {
- lvl += lwa9t;
- error =1;
- if(lvl == 5)
- {
- l7ba =677 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- }
- if(lvl == 10)
- {
- l7ba =870 ;
- DestroyObject(nbta[ch7al]);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- KillTimer(flbs);
- lvl = 0;
- error =0;
- }
- return true;
- }
- CMD:tree(playerid,params[])
- {
- PlayerInfo[playerid][flwe] = 0;
- PlayerInfo[playerid][fla7] = 1;
- return 1;
- }
- CMD:flower(playerid,params[])
- {
- PlayerInfo[playerid][fla7] = 0;
- PlayerInfo[playerid][flwe] = 1;
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_FIRE)
- {
- if(error == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your Plant Must Be Big");
- if(PlayerInfo[playerid][fla7] ==1)
- {
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
- KillTimer(lbs[playerid]);
- GetPlayerPos(playerid,PX,PY,PZ);
- GetPlayerFacingAngle(playerid, a);
- ch7al +=1;
- l7ba = 675;
- KillTimer(lbs[playerid]);
- lbs[ztmr] = SetTimerEx("lbss",1000,1,"d",playerid);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- lvl = 0;
- }
- if(error == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your Plant Must Be Big");
- if(PlayerInfo[playerid][flwe] ==1)
- {
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
- KillTimer(lbs[playerid]);
- GetPlayerPos(playerid,PX,PY,PZ);
- GetPlayerFacingAngle(playerid, a);
- ch7al +=1;
- l7ba = 675;
- KillTimer(flbs);
- flbs = SetTimerEx("flw",1000,1,"d",playerid);
- nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
- lvl = 0;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement