[POMOC]Level up


Započeo |Xeptic| Führer, Jul 01, 2011, 18:45:15 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:LARP
Detaljan opis problema:Evo ovako,znaci trazio sam po trazilici i nista nisam nasao pa sam odlucio otvoriti temu.Kako da stavim kad covjek ima idk. 4/4 respekta da mu automatski digne level?
Dio skripte:
Neznam sto trebate pa evo payday prvo
public PayDay()
{
	new string[128];
	new account,interest;
	new rent = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) && !IsPlayerNPC(i))
		{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    new bank = PlayerInfo[i][pAccount];
				    SendClientMessage(i, COLOR_LIGHTRED, "Niste odplatili dug, vrijeme zatvora.");
				    GameTextForPlayer(i, "~r~Uhicen!", 2000, 1);
				    SafeSetPlayerInterior(i, 6);
			   		SafeSetPlayerPos(i, 264.6288,77.5742,1001.0391);
		            PlayerInfo[i][pJailed] = 1;
		            SafeResetPlayerWeapons(i);
		            SafeResetPlayerMoney(i);
					SafeGivePlayerMoney(i, 1);
					WantedPoints[i] = 0;
					PlayerInfo[i][pAccount] = (bank + DebtMoney[i]);
					DebtMoney[i] = 0;
					PlayerInfo[i][pJailTime] = 240;
					TextDrawShowForPlayer(i, Textdraw1[i]);
					format(string, sizeof(string), "Zatvoreni ste na %d sekundi.   Jamstvo: Nemoguce", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_WHITE, string);
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new key = PlayerInfo[i][pPhousekey];
				if(key != 999)
				{
					rent = HouseInfo[key][hRent];
					if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
					{
						rent = 0;
					}
					else if(rent > GetPlayerMoney(i))
					{
						PlayerInfo[i][pPhousekey] = 999;
						SendClientMessage(i, COLOR_WHITE, "Iseljeni ste.");
						rent = 0;
					}
					HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
				}
				new tmpintrate;
				if (key != 999 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
				{
				    if(PlayerInfo[i][pRegularRank] > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
				}
				else
				{
				    if(PlayerInfo[i][pRegularRank] > 0) { tmpintrate = 3; }
					else { tmpintrate = 1; }
				}
				if(PlayerInfo[i][pPayDay] >= 5)
				{
				    Tax += TaxValue;//Should work for every player online
				    PlayerInfo[i][pAccount] -= TaxValue;
					new checks = PlayerInfo[i][pPayCheck] / 5;
					if(PlayerInfo[i][pRegularRank] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 10;
					    checks += bonus;
					}
				    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
				    account += checks;
				    if(PlayerInfo[i][pAccount] > 0)
				    {
				    	PlayerInfo[i][pAccount] -= ebill;
				    	SBizzInfo[4][sbTill] += ebill;
					}
					else
					{
					    ebill = 0;
					}
					interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
					PlayerInfo[i][pExp]++;
					PlayerPlayMusic(i);
					PlayerInfo[i][pAccount] = account+interest;
					SendClientMessage(i, COLOR_GREEN, "|___ Izvijesce banke ___|");
					format(string, sizeof(string), "  Iznos place: $%d   Porez: -$%d", checks, TaxValue);
					SendClientMessage(i, COLOR_WHITE, string);
					if(PlayerInfo[i][pPhousekey] != 999 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(string, sizeof(string), "  Struja: -$%d", ebill);
						SendClientMessage(i, COLOR_GRAD1, string);
					}
					format(string, sizeof(string), "  Stanje: $%d", account - checks);
					SendClientMessage(i, COLOR_WHITE, string);
					format(string, sizeof(string), "  Kamatna stopa: 0.%d posto",tmpintrate);
					SendClientMessage(i, COLOR_GRAD2, string);
					format(string, sizeof(string), "  Kamate: $%d", interest);
					SendClientMessage(i, COLOR_GRAD3, string);
					SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
					format(string, sizeof(string), "  Novo stanje: $%d", PlayerInfo[i][pAccount]);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  Rent: -$%d", rent);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "~y~Stigla je placa~n~~w~Novac je sjeo na vas racun");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					if(FarmerVar[i] == 0)
					{
						FarmerPickup[i][0] = 0;
					}
					if(DrugFarmerVar[i] == 0)
					{
						DrugFarmerPickup[i][0] = 0;
					}
					if(SmugglerWork[i] == 0)
					{
						PayDaySecure[i] = 0;
					}
					if(PlayerInfo[i][pRegularRank] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 5)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    SendClientMessage(i, COLOR_WHITE, "* Nisi igrao dovoljno dugo da dobijes placu.");
				}
			}
		}
	}
	SaveAccounts();
	Checkprop();
	new rand = random(2500); rand += 1245;
   	Jackpot += rand;
    SaveStuff();
    SaveAnticheat();
    format(string, sizeof(string), "Lotto Vijesti: Novi jackpot je narastao na $%d.", Jackpot);
	OOCOff(COLOR_WHITE, string);
	return 1;
}

strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

public split(const strsrc[], strdest[][], delimiter)
{
	new i, li;
	new aNum;
	new len;
	while(i <= strlen(strsrc)){
	    if(strsrc[i]==delimiter || i==strlen(strsrc)){
	        len = strmid(strdest[aNum], strsrc, li, i, 128);
	        strdest[aNum][len] = 0;
	        li = i+1;
	        aNum++;
		}
		i++;
	}
	return 1;
}



Zatim /buylevel ako treba

[color=red][b]if (strcmp(cmd, "/buylevel", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (gPlayerLogged[playerid] != 0)
			{
				/*PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);*/
				if(PlayerInfo[playerid][pLevel] >= 0)
				{
					new nxtlevel = PlayerInfo[playerid][pLevel]+1;
					/*new costlevel = nxtlevel*levelcost;//10k for testing purposes*/
					new expamount = nxtlevel*levelexp;
					new infostring[256];
					/*if(GetPlayerMoney(playerid) < costlevel)
					{
						format(infostring, 256, "   You do not have enough Cash ($%d)!",costlevel);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						return 1;
					}*/
					if (PlayerInfo[playerid][pExp] < expamount)
					{
						format(infostring, 256, "** Trebas %d Respekat-a, trenutno imas [%d] !",expamount,PlayerInfo[playerid][pExp]);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						return 1;
					}
					else
					{
						format(string, sizeof(string), "~g~LEVEL UP~n~~w~Sada si Level %d", nxtlevel);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
						PlayerPlayMusic(playerid);
						/*SafeGivePlayerMoney(playerid, (-costlevel));*/
						PlayerInfo[playerid][pLevel]++;
						if(PlayerInfo[playerid][pRegularRank] > 0)
						{
						    PlayerInfo[playerid][pExp] -= expamount;
						    new total = PlayerInfo[playerid][pExp];
						    if(total > 0)
						    {
						        PlayerInfo[playerid][pExp] = total;
						    }
						    else
						    {
						        PlayerInfo[playerid][pExp] = 0;
						    }
						}
						else
						{
							PlayerInfo[playerid][pExp] = 0;
						}
						PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
						GameTextForPlayer(playerid, string, 5000, 1);
						format(infostring, 256, "   Kupio si Level %d Koristi /upgrade", nxtlevel);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						format(infostring, 256, "   Imas %d neiskoristenih Upgrade Poena",PlayerInfo[playerid][gPupgrade]);
						SendClientMessage(playerid, COLOR_GRAD2, infostring);
						new y, m, d;
						new h,mi,s;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /levelup (%d)",d,m,y,h,mi,s,sendername,nxtlevel);
						CommandLog(string);
					}
				}
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Nisi ulogiran !");
			}
		}
		return 1;
	}[/b][/color]


Valjda je to potrebno neznam .. ili ako ima neki tut al bi bio zahvalan da ovdje se stavi kod ili nesto :*
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Jul 01, 2011, 18:45:39 POSLE PODNE od Apokalipsa