SA-MP Forums Archive
[FilterScript] LumberJack Job - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] LumberJack Job (/showthread.php?tid=388307)

Pages: 1 2


LumberJack Job - eMapper - 28.10.2012

Hello There!

Today I'm Releasing My New LumberJack Script - Job.

Well Name Says All..

Its Located New Chilliad Mountain.
Its Very Good, You Brake Down Trees And EARN Money!


Screenys:



And Code




And Here's You're PASTEBIN:


http://pastebin.com/jK2NF6ss




Comment/Rate




Thank You!

If You Cant Access Pastebin Here You Go:


PHP код:
// LumberJack Job Made By Me.
// I Hope You'll Leave Credits...
// If Not Go Fuck You're Self...
// This Is MySql =)
// I Hope You'll Like It!
#include <a_samp>
#include <a_mysql>
#define COLOR_ORANGE 0xFFA500FF
#define COLOR_SYSTEM 0xFFFFFFFF
#define COLOR_YELLOW3d 0xFFFF00FF
forward TimeDrov(playerid);
new 
Text3D:cutterd;
new 
cutt;
new 
bool:startjobd[MAX_PLAYERS];
new 
bool:woodcutter[MAX_PLAYERS];
new 
timecutt[MAX_PLAYERS];
new 
Oldskin[MAX_PLAYERS];
new 
kgcutt[MAX_PLAYERS];
new 
cuttrands;
new 
pickcutt;
new 
randomcutt[][1] = {
    {
25},{27},{29},{28},{33},{30},{35},{32},{37},{41},{36},
    {
42},{47},{52},{39},{40},{53},{54},{43},{44},{45}
};
public 
OnFilterScriptInit()
{
    
mysql_connect("localhost" "root""src""123321");
    new 
texts[56];
    
CreateObject(18259,-1897.80004883,-1971.00000000,86.59999847,0.00000000,0.00000000,0.00000000); //object(logcabinn01) (2)
    
CreateObject(1463,-1892.90002441,-1984.69995117,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (1)
    
CreateObject(1463,-1894.19995117,-1983.09997559,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (2)
    
CreateObject(1463,-1892.40002441,-1981.00000000,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (3)
    
CreateObject(1463,-1894.09997559,-1981.40002441,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (4)
    
CreateObject(1463,-1892.30004883,-1982.40002441,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (5)
    
CreateObject(1463,-1894.00000000,-1982.09997559,85.80000305,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (6)
    
CreateObject(1463,-1892.40002441,-1981.59997559,85.80000305,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (7)
    
CreateObject(1463,-1893.80004883,-1981.80004883,86.40000153,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (8)
    
CreateObject(1463,-1894.19995117,-1982.69995117,86.09999847,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (9)
    
CreateObject(1463,-1891.19995117,-1984.00000000,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (10)
    
CreateObject(1463,-1894.90002441,-1984.90002441,85.50000000,0.00000000,0.00000000,0.00000000); //object(dyn_woodpile2) (11)
    
CreateObject(14872,-1890.09997559,-1979.19995117,85.69999695,0.00000000,0.00000000,0.00000000); //object(kylie_logs) (1)
    
CreateObject(14872,-1892.09997559,-2013.30004883,78.80000305,0.00000000,0.00000000,0.00000000); //object(kylie_logs) (2)
    
CreateObject(14872,-1868.80004883,-2016.80004883,77.50000000,0.00000000,0.00000000,0.00000000); //object(kylie_logs) (3)
    
CreateObject(848,-1872.30004883,-2005.09997559,82.40000153,0.00000000,0.00000000,0.00000000); //object(dead_tree_20) (1)
    
CreateObject(684,-1888.40002441,-1973.19995117,85.69999695,3.00000000,0.00000000,0.00000000); //object(sm_fir_log02) (1)
    
CreateObject(846,-1892.00000000,-2019.80004883,77.00000000,17.50000000,0.00000000,0.00000000); //object(dead_tree_18) (1)
    
CreateObject(842,-1898.30004883,-1982.00000000,85.40000153,0.00000000,0.00000000,0.00000000); //object(dead_tree_14) (1)
    
CreateObject(834,-1882.90002441,-2009.50000000,81.69999695,0.00000000,0.00000000,0.00000000); //object(dead_tree_7) (1)
    
CreateObject(831,-1883.59997559,-1993.90002441,83.40000153,0.00000000,0.00000000,0.00000000); //object(dead_tree_5) (1)
    
CreateObject(831,-1917.90002441,-1904.50000000,86.19999695,0.00000000,0.00000000,0.00000000); //object(dead_tree_5) (2)
    
CreateObject(831,-1905.50000000,-1889.30004883,86.19999695,0.00000000,0.00000000,250.00000000); //object(dead_tree_5) (3)
    
pickcutt CreatePickup(1275,23,-1904.40002441,-1979.30004883,87.80000305);
    
Create3DTextLabel("Inventory is empty"0xFFA500FF, -1889.9906,-1976.1985,86.319840.000);
    return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
startjobd[playerid] == true)
    {
        if(
newkeys == KEY_JUMP || newkeys == KEY_FIRE || KEY_CROUCH || KEY_SECONDARY_ATTACK)
        {
              
DisablePlayerCheckpoint(playerid);
             
RemovePlayerAttachedObject(playerid,1);
             
ApplyAnimation(playerid,"PED","IDLE_tired",4.1,0,1,1,0,1);
             
SendClientMessage(playerid,0xAFAFAFAA," you drop the timber");
            
SetPlayerCheckpoint(playerid, -1898.4493,-2008.8124,80.6425,1.0);
        }
    }
    return 
1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
     if(
pickupid == pickcutt)
    {
        if(
woodcutter[playerid] == trueShowPlayerDialog(playerid,9999,DIALOG_STYLE_MSGBOX,"Operation Lumberjack","{EEADDF}>>{FFFFFF}You really want to finish the job?","Yes","No");
        else 
ShowPlayerDialog playerid999 DIALOG_STYLE_MSGBOX"Operation Lumberjack" "{} >> EEADDF {FFFFFF} You want to start a woodcutter?" "Yes" "No" ) ;
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
     new 
string[256];
     switch(
dialogid)
     {
         case 
999:
         {
             if(
response)
             {
                if ( 
IsPlayerAttachedObjectSlotUsed playerid) ) RemovePlayerAttachedObject playerid) , // pick pickaxe
                
woodcutter[playerid] = true;// work started
                
Oldskin[playerid] = GetPlayerSkin(playerid);// grean triangle for the skin
                
SetPlayerSkin(playerid133);//put the skin on hard workers
                
SetPlayerCheckpoint(playerid,-1898.4493,-2008.8124,80.6425,1.0);// Put the checkpoint
                
SendClientMessage(playeridCOLOR_SYSTEM"{EEADDF}>>{FFFFFF}You Started WoodMan!");
                
SendClientMessage(playeridCOLOR_SYSTEM"{EEADDF}>>{FFFFFF}on your map marked checkpoint");
                
SendClientMessage(playeridCOLOR_SYSTEM"{EEADDF}>>{FFFFFF}Go to him to start logging");
                
ApplyAnimation(playerid,"CHAINSAW","WEAPON_csaw",4.1,1,0,0,0,1);
                
ClearAnimations(playerid);
            }
        }
        case 
9999:
        {
            if(
response)
            {
                
woodcutter[playerid] = false;// player is not woodcutter
                
SetPlayerSkin(playerid,Oldskin[playerid]);// Put the old skin
                
DisablePlayerCheckpoint(playerid);// Harvesting emergency.
                
GivePlayerMoney(playeridkgcutt[playerid]/2);
                
format(stringsizeof(string), "{EEADDF}>>{FFFFFF}You earned% d $% d for cutting hardwood",kgcutt[playerid]/2,kgcutt[playerid]);
                
SendClientMessage(playeridCOLOR_SYSTEMstring);
                
kgcutt[playerid] = 0;
                if(
IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
                if(
IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);// took a wheelballer
                
if(IsPlayerAttachedObjectSlotUsed(playerid,3)) RemovePlayerAttachedObject(playerid,3);// ^^
            
}
        }
    }
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    new 
string[128];
    
ClearAnimations(playerid);
    
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
    if(
IsPlayerInRangeOfPoint(playerid6.0, -1898.4493,-2008.8124,80.6425))
    {
        
startjobd[playerid] = true;
        
ApplyAnimation(playerid,"CHAINSAW","WEAPON_csaw",4.1,1,0,0,0,11000);
        
GivePlayerWeapon(playerid91);
        
DisablePlayerCheckpoint(playerid);
        
timecutt[playerid] = SetTimerEx("TimeDrov",9800,false,"i"playerid);
        return 
1;
    }
    else if(
IsPlayerInRangeOfPoint(playerid3.0, -1896.6873,-1984.3062,86.1669) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        
startjobd[playerid] = false;
        
cuttrands random(sizeof(randomcutt));
        
kgcutt[playerid] += randomcutt[cuttrands][0];
        if(
IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);//
        
if(IsPlayerAttachedObjectSlotUsed(playerid,3)) RemovePlayerAttachedObject(playerid,3);//
        
format(stringsizeof(string), "The total number of hardwood %d",kgcutt[playerid]);
        
SendClientMessage(playerid, -1string);
        
format(stringsizeof(string), "You cut down hardwood %d ",randomcutt[cuttrands][0]);
        
SendClientMessage(playerid, -1string);
         
// cutter+=randomcutt[cuttrands][0];
        
cutt+=randomcutt[cuttrands][0];
        
cutt ++;
        
ApplyAnimation(playerid,"PED","IDLE_tired",4.1,1,0,0,0,2500);
        
SetPlayerCheckpoint(playerid, -1898.4493,-2008.8124,80.6425,1.0);
        
UpdateMine();
        return 
1;
    }
    return 
1;
}
public 
TimeDrov(playerid)
{
    if(
startjobd[playerid] == true)
    {
        
ResetPlayerWeapons(playerid);
        
SetPlayerAttachedObject(playerid114631,0.20,0.36,0.0,0.0,90.00.00.40.30.6);
        
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,1,0,0,1,1,1);
        
SetPlayerCheckpoint(playerid,-1896.6873,-1984.3062,86.1669,1.0);
    }
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    
woodcutter[playerid] = false;//
    
return 1;
}
UpdateMine()
{
    new 
string[56];
    
format(string,sizeof(string),"In Stock:\n %d Wood",cutt);
    
Update3DTextLabelText(cutterdCOLOR_YELLOW3dstring);
    
SaveMine();
    return 
1;
}
stock SaveMine()
{
    new 
ok[200];
     
format(ok,sizeof(ok),"INSERT INTO mine (cutt) VALUES (%d)"cutt);
     
mysql_query(ok);
    return 
1;



Comment/Rate


Thank You!






Re: LumberJack Job - eMapper - 28.10.2012

EDIT:

NVM FIXED.


Re: LumberJack Job - xplor09edy - 28.10.2012

Good work with this i think im gonna to use this


Re: LumberJack Job - eMapper - 28.10.2012

Quote:
Originally Posted by xplor09edy
Посмотреть сообщение
Good work with this i think im gonna to use this
Thanks!


Re: LumberJack Job - Lordzy - 28.10.2012

This looks pretty cool. Nice work but why mysql?


Re: LumberJack Job - eMapper - 28.10.2012

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
This looks pretty cool. Nice work but why mysql?
Thank You!

Why Mysql ?

No idea DDDDDDD


Re: LumberJack Job - eMapper - 28.10.2012

Thanks for REP guys

Soon Release Weapon TextDraw


Respuesta: LumberJack Job - [DOG]irinel1996 - 28.10.2012

Looks nice, I didn't check the code 100%, as the comments say you used MySQL then I suggest you make a SQLite version.


Re: LumberJack Job - JakeMiller - 28.10.2012

Nice work man!


Re: LumberJack Job - B-Matt - 28.10.2012

Nice one, and great idea dude!


Re: LumberJack Job - jpeg - 28.10.2012

Very Good.


Re: LumberJack Job - Flashhiee - 28.10.2012

Nice script.


Re: LumberJack Job - eMapper - 28.10.2012

Quote:
Originally Posted by irinel1996
View Post
Looks nice, I didn't check the code 100%, as the comments say you used MySQL then I suggest you make a SQLite version.
Quote:
Originally Posted by JakeMiller
View Post
Nice work man!
Quote:
Originally Posted by B-Matt
View Post
Nice one, and great idea dude!
Quote:
Originally Posted by jpeg
View Post
Very Good.
Quote:
Originally Posted by Flashhiee
View Post
Nice script.
Thank You All!!!!!!!!!!


Dont Forget To Check My Other Work:


https://sampforum.blast.hk/showthread.php?tid=388325


Thank You Once Again!


Re: LumberJack Job - eMapper - 28.10.2012

OFF::


Is It Possible To Make Time Machine?

When Recheas 120km/h You Travel Back In Time Where You Started?


Re: LumberJack Job - s1mpLe - 23.08.2013

Hei please give me a database .. or tutorial insert in database .. is not update 3D Text and no reward a money Please give me a help.


Re: LumberJack Job - par30 - 05.09.2013

no moany !!!!!!


Re: LumberJack Job - par30 - 05.09.2013

1000 wood work not Money!!!!!!!!!!!!!!!!!!!!!


Re: LumberJack Job - botak - 27.12.2013

Nice Job eMapper, REP+ For you. and how about you add Lumberjack that's not using mysql ?


Re: LumberJack Job - truon1230 - 27.12.2013

I got this errors:
Quote:

C:\Documents and Settings\Tommy\Desktop\Zombie Apocalypse\filterscripts\lumberjack.pwn(29) : warning 204: symbol is assigned a value that is never used: "texts"
C:\Documents and Settings\Tommy\Desktop\Zombie Apocalypse\filterscripts\lumberjack.pwn(185) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re : LumberJack Job - med01 - 27.12.2013

truon1230 you have all required include?