[HELP] Jobs Minner
#1

How can i make the miner job like on this video? https://www.youtube.com/watch?v=K6fPEKXrxdE


StartJob
PHP код:
CMD:kopaj(playeridparams[])
{
if( 
PlayerInfoplayerid ][ pJob ] == 32 )
    {
    if( 
JobDutyplayerid ] == ) return SendErrorMessageplayerid"Nemate opremu!" );
    if(
ZapoceoRudara[playerid] == 1) return SendErrorMessageplayerid"Vec ste poceli sa poslom." );
    
SetPlayerCheckpointplayerid375.6536,997.6815,-42.17612.5 );
    
SCM(playerid, -1,"{ff9966}* Vas posao je da kopate zemlju u rudniku i trazite rudu!" );
    
SCM(playerid, -1,"{ff9966}* Kada dodjete na marker stisnite {ff3300}SPACE !" );
    
ZapoceoRudara[playerid] = 1;
    }
return 
1;

OnPlayerEnterCheckpoint
PHP код:
  if(ZapoceoRudara[playerid] == 1)
    {
    if(
IsPlayerInRangeOfPoint(playerid2.0375.6536,997.6815,-42.1761))
    {
    
ClearAnimations(playerid); SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
DisablePlayerCheckpoint(playerid);
    
ZapoceoRudara[playerid] = 2;
    }
    }
     if(
ZapoceoRudara[playerid] == 2)
    {
    if(
IsPlayerInRangeOfPoint(playerid2.0373.1700,983.3531,-42.0894))
    {
    
ClearAnimations(playerid); SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
DisablePlayerCheckpoint(playerid);
    
ZapoceoRudara[playerid] = 3;
    }
    }
    if(
ZapoceoRudara[playerid] == 3)
    {
    if(
IsPlayerInRangeOfPoint(playerid2.0366.3725,995.9056,-41.9491))
    {
    
ClearAnimations(playerid); SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
DisablePlayerCheckpoint(playerid);
    
ZapoceoRudara[playerid] = 4;
    }
    }
    if(
ZapoceoRudara[playerid] == 4)
    {
    if(
IsPlayerInRangeOfPoint(playerid2.0365.7737,985.9380,-41.9491))
    {
    
ClearAnimations(playerid); SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
DisablePlayerCheckpoint(playerid);
    
ZapoceoRudara[playerid] = 5;
    }
    }
    if(
ZapoceoRudara[playerid] == 5)
    {
    if(
IsPlayerInRangeOfPoint(playerid2.0364.4261,989.3689,-41.9491))
    {
    
ClearAnimations(playerid); SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
DisablePlayerCheckpoint(playerid);
    
ZapoceoRudara[playerid] = 6;
    }
    }
    if(
ZapoceoRudara[playerid] == 6)
    {
    if(
IsPlayerInRangeOfPoint(playerid2.0444.1266,967.8034,-42.2886))
    {
    
RemovePlayerAttachedObject(playeridOBJECT_NOSI);
    
ClearAnimations(playerid); SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    
DisablePlayerCheckpoint(playerid);
     new 
randpay 289 random(187);
    
PlayerInfo[playerid][pAccount] += randpay;
    new 
ceoisplata[1024];
    new 
isplatistr[256];
    new 
isplatistr1[256];
    new 
isplatistr2[256];
    
format(isplatistrsizeof(isplatistr), "Na vas ziro racun uplaceno je: %d din.\n"randpay);
    
format(isplatistr1sizeof(isplatistr1), "Stanje Racuna: %d din.\n"PlayerInfo[playerid][pAccount]);
    
format(isplatistr2sizeof(isplatistr2), "Novac uvek mozete podici u banci ili na bankomatu\n");
    
format(ceoisplata670,"%s%s%s",isplatistr,isplatistr1,isplatistr2);
    
ShowPlayerDialog(playerid,DIALOG_ISPLATA,DIALOG_STYLE_MSGBOX,"Zarada",ceoisplata,"Ok","");
    }
    } 
Pod OnPlayerKeyStateChange
PHP код:
if (PRESSED(KEY_SPRINT))
{
    if(
KodRuda(playerid))
    {
       if(
ZapoceoRudaraplayerid ] == 1)
    {
        
//rudarPosao[ playerid ][ rudarIskopano ]++;
        
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
        
rudarTimer[playerid] = SetTimerEx("Kopanje1"10000false"d"playerid);
        
OpremaVreme[playerid] = gettime() + 10;
        
ApplyAnimationplayerid"CHAINSAW""CSAW_1"4.11111);
        
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
    }
    else if(
ZapoceoRudaraplayerid ] == 2)
    {
        
//rudarPosao[ playerid ][ rudarIskopano ]++;
        
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
        
rudarTimer[playerid] = SetTimerEx("Kopanje2"10000false"d"playerid);
        
OpremaVreme[playerid] = gettime() + 10;
        
ApplyAnimationplayerid"CHAINSAW""CSAW_1"4.11111);
        
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
    }
    else if(
ZapoceoRudaraplayerid ] == 3)
    {
        
//rudarPosao[ playerid ][ rudarIskopano ]++;
        
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
        
rudarTimer[playerid] = SetTimerEx("Kopanje3"10000false"d"playerid);
        
OpremaVreme[playerid] = gettime() + 10;
        
ApplyAnimationplayerid"CHAINSAW""CSAW_1"4.11111);
        
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
    }
    else if(
ZapoceoRudaraplayerid ] == 4)
    {
        
//rudarPosao[ playerid ][ rudarIskopano ]++;
        
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
        
rudarTimer[playerid] = SetTimerEx("Kopanje4"10000false"d"playerid);
        
OpremaVreme[playerid] = gettime() + 10;
        
ApplyAnimationplayerid"CHAINSAW""CSAW_1"4.11111);
        
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
    }
    else if(
ZapoceoRudaraplayerid ] == 5)
    {
        
//rudarPosao[ playerid ][ rudarIskopano ]++;
        
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
        
rudarTimer[playerid] = SetTimerEx("Kopanje5"10000false"d"playerid);
        
OpremaVreme[playerid] = gettime() + 10;
        
ApplyAnimationplayerid"CHAINSAW""CSAW_1"4.11111);
        
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
    }
    }
return 
true;

PHP код:
forward Kopanje1(playerid);
public 
Kopanje1(playerid)
{
SetPlayerCheckpoint(playerid373.1700,983.3531,-42.0894,2.0);
SCM(playerid,-1,"Oznaceno vam je novo mesto, pratite marker!");
return 
true;
}
forward Kopanje2(playerid);
public 
Kopanje2(playerid)
{
SetPlayerCheckpoint(playerid366.3725,995.9056,-41.9491,2.0);
SCM(playerid,-1,"Oznaceno vam je novo mesto, pratite marker!");
return 
true;
}
forward Kopanje3(playerid);
public 
Kopanje3(playerid)
{
SetPlayerCheckpoint(playerid365.7737,985.9380,-41.9491,2.0);
SCM(playerid,-1,"Oznaceno vam je novo mesto, pratite marker!");
return 
true;
}
forward Kopanje4(playerid);
public 
Kopanje4(playerid)
{
SetPlayerCheckpoint(playerid364.4261,989.3689,-41.9491,2.0);
SCM(playerid,-1,"Oznaceno vam je novo mesto, pratite marker!");
return 
true;
}
forward Kopanje5(playerid);
public 
Kopanje5(playerid)
{
SetPlayerCheckpoint(playerid444.1266,967.8034,-42.2886,2.0);
SCM(playerid,-1,"Oznaceno vam je novo mesto, pratite marker!");
return 
true;
}
forward Kopanje6(playerid);
public 
Kopanje6(playerid)
{
SetPlayerSpecialAction(playeridSPECIAL_ACTION_CARRY);
SetPlayerAttachedObject(playeridOBJECT_NOSI90510.4948230.7209930.0000000.0000000.0000000.0000001.0000001.0000001.000000 );
//SetPlayerAttachedObject(playerid, OBJECT_NOSI, 1303, 1,0.20,0.36,0.0,0.0,90.0, 0.0, 0.4, 0.3, 0.6);
ApplyAnimationplayerid"CARRY""crry_prtial"4.101111);
SetPlayerCheckpointplayerid444.1266,967.8034,-42.28862.5 );
ClearAnimationsplayerid );
SCMplayerid, -1,"Iskopali ste rudu, odnesite je do checkpointa!" );
return 
true;

Reply
#2

BUMP PLEASE
Reply
#3

Remember 24 hour bumps.

I'd look at stages displaying checkpoints in a single function, rather than separate functions for each checkpoint.
Reply
#4

AddPlayerClass(260,375.6536,997.6815,-42.1761,24.1772,0,0,0,0,0,0); // 1 Start Job
AddPlayerClass(260,373.1700,983.3531,-42.0894,165.1785,0,0,0,0,0,0); // 2
AddPlayerClass(260,366.3725,995.9056,-41.9491,35.4573,0,0,0,0,0,0); // 3
AddPlayerClass(260,365.7737,985.9380,-41.9491,172.6985,0,0,0,0,0,0); // 4
AddPlayerClass(260,364.4261,989.3689,-41.9491,78.6977,0,0,0,0,0,0); // 5
AddPlayerClass(260,444.1266,967.8034,-42.2886,191.1620,0,0,0,0,0,0); // 6 Finish Job

Checkpoint
Reply
#5

What is going wrong with the code currently, or where did you get your current code from?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)