Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================== *
- //Farming System por iTakelot
- //==============================================================================
- #include a_samp
- #include zcmd
- #include sscanf2
- //==============================================================================
- forward Menssagens();
- #define color_whide 0xffffffff
- #define color_greey 0x00cc00ff
- #define color_puple 0xff0000ff
- //==============================================================================
- NEW RandomColors [] =
- {
- 0xFFFFFFFF,
- 0xFFFF00FF
- };
- NEW Planta,
- FarmerVehicles [ 5 ],
- bool:PlayerFazendeiro [ MAX_PLAYERS ],
- bool:Pode_Colher [ MAX_PLAYERS ]
- ;
- //==============================================================================
- //Inicio do script
- //==============================================================================
- public OnFilterScriptInit(){
- FarmerVehicles[0] = AddStaticVehicle(532,-322.2967,-1350.3434,10.5241,270.7830,0,0); // pos 1
- FarmerVehicles[1] = AddStaticVehicle(532,-322.6843,-1340.8116,10.3685,272.3377,0,0); // pos 2
- FarmerVehicles[2] = AddStaticVehicle(532,-323.0977,-1331.4840,10.4024,271.4319,0,0); // pos 3
- FarmerVehicles[3] = AddStaticVehicle(532,-323.1684,-1322.5546,10.4159,270.6801,0,0); // pos 4
- FarmerVehicles[4] = AddStaticVehicle(532,-322.1127,-1358.8835,10.8958,269.5284,0,0); // pos 5
- print( "\n_____________________________" );
- print( "Farming Loaded Por iTakelot ..." );
- print( "_____________________________\n" );
- SetTimer("Menssagens", 300000, TRUE);
- RETURN 1;
- }
- command(iniciar_p, playerid, params[])
- {
- SendClientMessage(playerid, color_greey, "{0080C0}|WAN|: Lucrezi ca fermier, urmareste punctele de pe harta pentru a planta.");
- SetPlayerCheckpoint(playerid, -309.0990,-1381.1797,10.7049, 10);
- RETURN 1;
- }
- command(fazendeiro, playerid, params[])
- {
- IF(PlayerFazendeiro[playerid] == TRUE)
- RETURN SendClientMessage(playerid, -1, "{FF0000}|ERROR|: Deja esti fermier!");
- SendClientMessage(playerid, color_whide, "{0080C0}|ERROR|: Lucrezi ca fermier");
- SendClientMessage(playerid, color_whide, "{0080C0}|FARM|: Acum lucrezi ca fermier tasteaza /plantar pentru a plata.");
- SetPlayerPos(playerid,-326.2115,-1369.0287,10.7232);
- SetPlayerSkin(playerid,158);
- GivePlayerWeapon(playerid, WEAPON_SHOVEL, 64);
- PlayerFazendeiro[playerid] = TRUE;
- RETURN 1 ;
- }
- command(sair_fazendeiro, playerid, params[])
- {
- PlayerFazendeiro[playerid] = TRUE;
- Pode_Colher[playerid] = FALSE;
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, color_whide, "{0080C0}|WAN|: Nu esti fermier.");
- RETURN 1 ;
- }
- command(colher, playerid, params[])
- {
- IF (Pode_Colher[playerid] == FALSE) RETURN SendClientMessage(playerid, color_greey, "{0080C0}|ERROR|: Não ah frutos...");
- Pode_Colher[playerid] = FALSE;
- GivePlayerMoney(playerid, 10000);
- SendClientMessage(playerid, color_greey, "{00FF00}: Ai recoltat și ai câștigat R$ {FFFF00}10000");
- RETURN 1;
- }
- public OnPlayerConnect(playerid){
- RETURN Pode_Colher[playerid] = FALSE;
- }
- public OnPlayerDeath(playerid, killerid, reason){
- RETURN PlayerFazendeiro[playerid] = FALSE;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- IF(IsPlayerInRangeOfPoint(playerid, 10, -309.0990,-1381.1797,10.7049))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -286.6838,-1366.6523,9.2448, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -286.6838,-1366.6523,9.2448))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -299.1016,-1345.1233,7.8737, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -299.1016,-1345.1233,7.8737))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -285.5391,-1314.0519,9.4996, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -285.5391,-1314.0519,9.4996))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -263.7585,-1322.7645,9.2727, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -263.7585,-1322.7645,9.2727))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -247.7353,-1312.8854,10.7708, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -247.7353,-1312.8854,10.7708))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -230.6390,-1326.7452,10.5278, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -230.6390,-1326.7452,10.5278))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -208.9200,-1312.6355,8.0123, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -208.9200,-1312.6355,8.0123))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -184.9501,-1314.5737,6.7411, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -184.9501,-1314.5737,6.7411))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -165.0671,-1340.6115,3.1610, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -165.0671,-1340.6115,3.1610))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -182.6981,-1357.5033,4.1997, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -182.6981,-1357.5033,4.1997))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -166.5868,-1381.2855,3.2646, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -166.5868,-1381.2855,3.2646))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -169.7452,-1395.7577,3.3153, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -169.7452,-1395.7577,3.3153))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -162.0952,-1412.2350,3.0394, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -162.0952,-1412.2350,3.0394))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -192.4460,-1407.2355,3.9017, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -192.4460,-1407.2355,3.9017))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -207.5008,-1421.8888,3.2155, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -207.5008,-1421.8888,3.2155))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -226.2545,-1411.9092,6.5599, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -226.2545,-1411.9092,6.5599))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -247.6317,-1427.6404,6.6805, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -247.6317,-1427.6404,6.6805))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -263.1941,-1420.1913,9.3854, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -263.1941,-1420.1913,9.3854))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -284.1987,-1431.4486,12.0138, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -284.1987,-1431.4486,12.0138))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -300.6557,-1424.9337,14.0705, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -300.6557,-1424.9337,14.0705))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -320.6297,-1431.7501,15.1514, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -320.6297,-1431.7501,15.1514))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -330.9842,-1410.7192,14.1269, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -330.9842,-1410.7192,14.1269))
- {
- NEW FLOAT:X, FLOAT:Y, FLOAT:Z, FLOAT:A;
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
- SetPlayerCheckpoint(playerid, -343.0883,-1369.3920,14.4816, 10);
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- Planta = CreateObject(813, X, Y, Z-1.0, 0.0, 0.0, A);
- }
- IF(IsPlayerInRangeOfPoint(playerid, 10, -343.0883,-1369.3920,14.4816))
- {
- NEW vehicleid = GetPlayerVehicleID(playerid);
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, color_greey, "{00FF00}|FARM|: Congratulations successfully planted feet!");
- SendClientMessage(playerid, color_puple,"{00FF00}|FARM|: wait until they deem frutod to harvest");
- PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
- SetVehicleToRespawn(vehicleid);
- SetTimerEx("Terminou_Plantar", 2000, FALSE, "i", playerid);
- }
- RETURN 1;
- }
- forward Terminou_Plantar(playerid);
- public Terminou_Plantar(playerid){
- Pode_Colher[playerid] = TRUE;
- SendClientMessage(playerid, color_puple,"{00FF00}|FARM|: the fruits grown and now you can reap!");
- PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
- RETURN 1;
- }
- NEW Mensagens[][] =
- {
- "You want to be a farmer? use the command / fazendeiro",
- "This server has a farm system by Takelot"
- };
- public Menssagens()
- {
- NEW random2 = random(sizeof(RandomColors));
- NEW randMSG = random(sizeof(Mensagens));
- SendClientMessageToAll(RandomColors[random2], Mensagens[randMSG]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement