SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 28/10/2012, 09:47 AM   #1
eMapper
Banned
 
Join Date: Oct 2012
Location: In You're Hard Disk
Posts: 73
Reputation: 46
Default LumberJack Job

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 Code:
// 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!




Last edited by eMapper; 28/10/2012 at 09:50 AM. Reason: NOT [MAP] ITS FILTERSCRIPT :@
eMapper is offline   Reply With Quote
Old 28/10/2012, 09:50 AM   #2
eMapper
Banned
 
Join Date: Oct 2012
Location: In You're Hard Disk
Posts: 73
Reputation: 46
Default Re: LumberJack Job

EDIT:

NVM FIXED.
eMapper is offline   Reply With Quote
Old 28/10/2012, 09:55 AM   #3
xplor09edy
Big Clucker
 
xplor09edy's Avatar
 
Join Date: Oct 2012
Location: Romania & scripting.dll
Posts: 129
Reputation: 12
Default Re: LumberJack Job

Good work with this i think im gonna to use this
__________________
Please press on (+1 Rep) when i helped you.

CONNECT: IP: 178.156.200.153:7778
My Relase:
xplor09edy is offline   Reply With Quote
Old 28/10/2012, 09:57 AM   #4
eMapper
Banned
 
Join Date: Oct 2012
Location: In You're Hard Disk
Posts: 73
Reputation: 46
Default Re: LumberJack Job

Quote:
Originally Posted by xplor09edy View Post
Good work with this i think im gonna to use this
Thanks!
eMapper is offline   Reply With Quote
Old 28/10/2012, 10:22 AM   #5
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,701
Reputation: 1177
Default Re: LumberJack Job

This looks pretty cool. Nice work but why mysql?
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 28/10/2012, 10:23 AM   #6
eMapper
Banned
 
Join Date: Oct 2012
Location: In You're Hard Disk
Posts: 73
Reputation: 46
Default Re: LumberJack Job

Quote:
Originally Posted by Lordz™ View Post
This looks pretty cool. Nice work but why mysql?
Thank You!

Why Mysql ?

No idea DDDDDDD
eMapper is offline   Reply With Quote
Old 28/10/2012, 10:59 AM   #7
eMapper
Banned
 
Join Date: Oct 2012
Location: In You're Hard Disk
Posts: 73
Reputation: 46
Default Re: LumberJack Job

Thanks for REP guys

Soon Release Weapon TextDraw
eMapper is offline   Reply With Quote
Old 28/10/2012, 12:09 PM   #8
[DOG]irinel1996
High-roller
 
[DOG]irinel1996's Avatar
 
Join Date: Jan 2010
Posts: 1,469
Reputation: 288
Default Respuesta: LumberJack Job

Looks nice, I didn't check the code 100%, as the comments say you used MySQL then I suggest you make a SQLite version.
[DOG]irinel1996 is offline   Reply With Quote
Old 28/10/2012, 12:25 PM   #9
JakeMiller
Big Clucker
 
JakeMiller's Avatar
 
Join Date: Feb 2012
Posts: 75
Reputation: 11
Default Re: LumberJack Job

Nice work man!
JakeMiller is offline   Reply With Quote
Old 28/10/2012, 12:34 PM   #10
B-Matt
Big Clucker
 
B-Matt's Avatar
 
Join Date: Oct 2012
Location: Croatia
Posts: 162
Reputation: 45
Default Re: LumberJack Job

Nice one, and great idea dude!
B-Matt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 06:06 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.