12.12.2016, 16:28
(
Последний раз редактировалось Markoni990; 12.12.2016 в 17:10.
)
How can i make the miner job like on this video? https://www.youtube.com/watch?v=K6fPEKXrxdE
StartJob
OnPlayerEnterCheckpoint
Pod OnPlayerKeyStateChange
StartJob
PHP код:
CMD:kopaj(playerid, params[])
{
if( PlayerInfo[ playerid ][ pJob ] == 32 )
{
if( JobDuty[ playerid ] == 0 ) return SendErrorMessage( playerid, "Nemate opremu!" );
if(ZapoceoRudara[playerid] == 1) return SendErrorMessage( playerid, "Vec ste poceli sa poslom." );
SetPlayerCheckpoint( playerid, 375.6536,997.6815,-42.1761, 2.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;
}
PHP код:
if(ZapoceoRudara[playerid] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 375.6536,997.6815,-42.1761))
{
ClearAnimations(playerid); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
DisablePlayerCheckpoint(playerid);
ZapoceoRudara[playerid] = 2;
}
}
if(ZapoceoRudara[playerid] == 2)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 373.1700,983.3531,-42.0894))
{
ClearAnimations(playerid); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
DisablePlayerCheckpoint(playerid);
ZapoceoRudara[playerid] = 3;
}
}
if(ZapoceoRudara[playerid] == 3)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 366.3725,995.9056,-41.9491))
{
ClearAnimations(playerid); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
DisablePlayerCheckpoint(playerid);
ZapoceoRudara[playerid] = 4;
}
}
if(ZapoceoRudara[playerid] == 4)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 365.7737,985.9380,-41.9491))
{
ClearAnimations(playerid); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
DisablePlayerCheckpoint(playerid);
ZapoceoRudara[playerid] = 5;
}
}
if(ZapoceoRudara[playerid] == 5)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 364.4261,989.3689,-41.9491))
{
ClearAnimations(playerid); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
DisablePlayerCheckpoint(playerid);
ZapoceoRudara[playerid] = 6;
}
}
if(ZapoceoRudara[playerid] == 6)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 444.1266,967.8034,-42.2886))
{
RemovePlayerAttachedObject(playerid, OBJECT_NOSI);
ClearAnimations(playerid); SetPlayerSpecialAction(playerid, SPECIAL_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(isplatistr, sizeof(isplatistr), "Na vas ziro racun uplaceno je: %d din.\n", randpay);
format(isplatistr1, sizeof(isplatistr1), "Stanje Racuna: %d din.\n", PlayerInfo[playerid][pAccount]);
format(isplatistr2, sizeof(isplatistr2), "Novac uvek mozete podici u banci ili na bankomatu\n");
format(ceoisplata, 670,"%s%s%s",isplatistr,isplatistr1,isplatistr2);
ShowPlayerDialog(playerid,DIALOG_ISPLATA,DIALOG_STYLE_MSGBOX,"Zarada",ceoisplata,"Ok","");
}
}
PHP код:
if (PRESSED(KEY_SPRINT))
{
if(KodRuda(playerid))
{
if(ZapoceoRudara[ playerid ] == 1)
{
//rudarPosao[ playerid ][ rudarIskopano ]++;
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
rudarTimer[playerid] = SetTimerEx("Kopanje1", 10000, false, "d", playerid);
OpremaVreme[playerid] = gettime() + 10;
ApplyAnimation( playerid, "CHAINSAW", "CSAW_1", 4.1, 1, 1, 1, 1, 1 );
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
}
else if(ZapoceoRudara[ playerid ] == 2)
{
//rudarPosao[ playerid ][ rudarIskopano ]++;
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
rudarTimer[playerid] = SetTimerEx("Kopanje2", 10000, false, "d", playerid);
OpremaVreme[playerid] = gettime() + 10;
ApplyAnimation( playerid, "CHAINSAW", "CSAW_1", 4.1, 1, 1, 1, 1, 1 );
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
}
else if(ZapoceoRudara[ playerid ] == 3)
{
//rudarPosao[ playerid ][ rudarIskopano ]++;
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
rudarTimer[playerid] = SetTimerEx("Kopanje3", 10000, false, "d", playerid);
OpremaVreme[playerid] = gettime() + 10;
ApplyAnimation( playerid, "CHAINSAW", "CSAW_1", 4.1, 1, 1, 1, 1, 1 );
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
}
else if(ZapoceoRudara[ playerid ] == 4)
{
//rudarPosao[ playerid ][ rudarIskopano ]++;
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
rudarTimer[playerid] = SetTimerEx("Kopanje4", 10000, false, "d", playerid);
OpremaVreme[playerid] = gettime() + 10;
ApplyAnimation( playerid, "CHAINSAW", "CSAW_1", 4.1, 1, 1, 1, 1, 1 );
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
}
else if(ZapoceoRudara[ playerid ] == 5)
{
//rudarPosao[ playerid ][ rudarIskopano ]++;
if(gettime() < OpremaVreme[playerid]) return SCM(playerid, -1,"Ovu opciju mozete koristiti svakih 10 sekundi!");
rudarTimer[playerid] = SetTimerEx("Kopanje5", 10000, false, "d", playerid);
OpremaVreme[playerid] = gettime() + 10;
ApplyAnimation( playerid, "CHAINSAW", "CSAW_1", 4.1, 1, 1, 1, 1, 1 );
SCM(playerid,-1,"Kopate rudu sacekajte malo.");
}
}
return true;
}
PHP код:
forward Kopanje1(playerid);
public Kopanje1(playerid)
{
SetPlayerCheckpoint(playerid, 373.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(playerid, 366.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(playerid, 365.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(playerid, 364.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(playerid, 444.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(playerid, SPECIAL_ACTION_CARRY);
SetPlayerAttachedObject(playerid, OBJECT_NOSI, 905, 1, 0.494823, 0.720993, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.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);
ApplyAnimation( playerid, "CARRY", "crry_prtial", 4.1, 0, 1, 1, 1, 1, 1 );
SetPlayerCheckpoint( playerid, 444.1266,967.8034,-42.2886, 2.5 );
ClearAnimations( playerid );
SCM( playerid, -1,"Iskopali ste rudu, odnesite je do checkpointa!" );
return true;
}