[Help]PayDay
#1

When the type command /payday, it will not throw public payday
Also every hour it should throw out a payday and not to expel


Код:
	if(strcmp(cmd, "/payday", true) == 0)
	{
 		if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] != 1338) return NisiOvlasten(playerid);
	        {
	            if(PlayerInfo[playerid][pAdminLogin] == 0) return NisiPrijavljen(playerid);
	            {
        	    	foreach(Player, i)
	    			{
						Placa(i);
						}
			  		}
				}
			}
	return 1;
	}
Код:
public SyncTime()
{
	new string[64];
	new tmphour;
	new tmpminute;
	new tmpsecond;
	gettime(tmphour, tmpminute, tmpsecond);
	FixHour(tmphour);
	tmphour = shifthour;
	if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
	{
		format(string, sizeof(string), "California RP: Sada je %d:00 sati.",tmphour);
		BroadCast(COLOR_WHITE,string);
		ghour = tmphour;
		foreach(Player, i)
		Placa(i);
		if (realtime)
		{
			SetWorldTime(tmphour);
		}
	}
}
Код:
public Placa(i)
{
    new string[256];
    new imekredita[20];
    new placa;
    new stopakredita;
    new porez;
    new sat, minuta, sekunda;
    new godina, mjesec, dan;
    new ukupno;
    gettime(sat, minuta, sekunda);
    getdate(godina, mjesec, dan);
    PlayerInfo[i][pRespect]++;
    PlayerInfo[i][pSatiIgranja]++;
    PlayerInfo[i][pRadniStaz]++;
    PlayerInfo[i][pUgovor]++;
    PlayerInfo[i][pKreditRata]--;
    stopakredita = PlayerInfo[i][pStopaKredita];
    ukupno = placa - stopakredita - porez;
    if(PlayerInfo[i][pLevel] > 5 || PlayerInfo[i][pLevel] < 1) return placa=(random(130-100)+100);
    if(PlayerInfo[i][pLevel] > 11 || PlayerInfo[i][pLevel] < 6) return placa=(random(160-130)+130);
    if(PlayerInfo[i][pLevel] > 17 || PlayerInfo[i][pLevel] < 12) return placa=(random(190-160)+160);
    if(PlayerInfo[i][pLevel] > 99 || PlayerInfo[i][pLevel] < 18) return placa=(random(240-190)+190);
    if(PlayerInfo[i][pPosao] == 0) return placa=(random(110-80)+80);
   	if(PlayerInfo[i][pKredit] == 1) { imekredita = "Mali kredit"; }
	else if(PlayerInfo[i][pKredit] == 2) { imekredita = "Veliki kredit"; }
	else if(PlayerInfo[i][pKredit] == 3) { imekredita = "Expres kredit"; }
    if(PlayerInfo[i][pPhousekey] != 255) return porez=(random(25-10)+10);
    if(PlayerInfo[i][pPbiskey] != 255) return porez=(random(30-15)+15);
    if(PlayerInfo[i][pPbiskey] != 255 || PlayerInfo[i][pPbiskey] != 255) return porez=(random(45-30)+30);
    if(PlayerInfo[i][pKreditRata] == 0)
    {
    SCM(i, COLOR_ORANGE,"Otplatili ste zadnju ratu kredita. Sada mozete doci novi kredit.");
    PlayerInfo[i][pKredit] = 0;
    PlayerInfo[i][pStopaKredita] = 0;
    }
	format(string,sizeof(string),"|________________________Placa________________________|");
	SCM(i,COLOR_YELLOW2,string);
	format(string,sizeof(string),"Datum: "COL_BLUE"%d.%d.%d."COL_WHITE" | Vrijeme: "COL_BLUE"%d:%d:%d", dan, mjesec, godina, sat, minuta, sekunda);
	SCM(i,COLOR_WHITE,string);
	format(string,sizeof(string),"Placa: "COL_LIME"$%d", placa);
	SCM(i,COLOR_WHITE,string);
	if(PlayerInfo[i][pKredit] > 0)
	{
	format(string,sizeof(string),"Kredit: %s", imekredita);
	SCM(i,COLOR_WHITE,string);
	format(string,sizeof(string),"Rata kredita: "COL_RED"-$%d", stopakredita);
	SCM(i,COLOR_WHITE,string);
	}
	if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
	{
	format(string,sizeof(string),"Porez: "COL_RED"-%d", porez);
	SCM(i,COLOR_WHITE,string);
	}
	format(string,sizeof(string),"Ukupan profit: "COL_LIME"$%d", ukupno);
	SCM(i,COLOR_WHITE,string);
	format(string,sizeof(string),"|________________________Placa________________________|");
	SCM(i,COLOR_YELLOW2,string);
	PlayerInfo[i][pBanka] += ukupno;
	SacuvajIgraca(i);
	return 1;
}
Reply


Messages In This Thread
[Help]PayDay - by vannesenn - 29.11.2012, 06:32
Re: [Help]PayDay - by vannesenn - 29.11.2012, 07:26
Re: [Help]PayDay - by vannesenn - 29.11.2012, 11:22
Re: [Help]PayDay - by vannesenn - 30.11.2012, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)