[pomoc]Da se Leveli ne prebacivaju preko komande

Započeo [LOb]mistic144, April 12, 2013, 20:21:35 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: CLRP edit
Detaljan opis problema: Kako da napravim da u pay day broji respekte umjesto komande da se sami broje i da se sami lvli prebacuju
Dio skripte:
public PayDay()
{
	new string[128];
	new coordstring[128];
	new coordstring1[128];
	new coordstring2[128];
	new coordstring3[128];
	new coordstring4[128];
	new coordstring5[128];
	new coordstring6[128];
	new coordstring7[128];
	new coordstring8[128];
	new payday[512];
	new account,interest;
	new rent = 0;
	foreach (Player, i)
	{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    SendClientMessage(i, COLOR_LIGHTRED, "Niste uspjeli da vratite dug, idete u zatvor.");
				    GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
				    new rand = random(sizeof(gRandomJailSpawns));
					SetPlayerPos(i, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
		            PlayerInfo[i][pJailed] = 1;
		            SafeResetPlayerWeapons(i);
		            SafeResetPlayerMoney(i);
					WantedPoints[i] = 0;
					PlayerInfo[i][pJailTime] = 240;
					format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_WHITE, string);
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new tmpintrate;
				if (PlayerInfo[i][pPhousekey] != 255 && strcmp(playername2, Houses[PlayerInfo[i][pPhousekey]][hOwner], true) == 0)
				{
				    if(GetPVarInt(i, "DonatorRank")  > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//Houses[key][hLevel]
				}
				else
				{
				    if(GetPVarInt(i, "DonatorRank")  > 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] / 50;
					if(PlayerInfo[i][pVip] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 100;
					    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);
					if(respekti == 0) // Ako su iskljuceni
					{
					    PlayerInfo[i][pExp] ++; //++ Znaci da dodaje igracima 1
					}
					else // U suprotnom
					{
					    PlayerInfo[i][pExp] += 2; //+= 2 Znaci dodaje igracima 2
					}
					PlayerInfo[i][pAccount] = account+interest;
					format(coordstring, sizeof(coordstring),  " {157DEC}Plata: {FFFFFF}$%d\n {157DEC}Takse: {FFFFFF}-$%d\n", checks, TaxValue);
					if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(coordstring1, sizeof(coordstring1), " {157DEC}Racun za struju: {FFFFFF}-$%d\n", ebill);
					}
					format(coordstring2, sizeof(coordstring2), " {157DEC}Staro Stanje: {FFFFFF}$%d\n", account - checks);
					format(coordstring3, sizeof(coordstring3), " {157DEC}Kamata: {FFFFFF}0.%d posto\n",tmpintrate);
					format(coordstring4, sizeof(coordstring4), " {157DEC}Kamatni Interes: {FFFFFF}$%d\n", interest);
					format(coordstring5, sizeof(coordstring5), " {157DEC}Novo stanje: {FFFFFF}$%d\n", PlayerInfo[i][pAccount]);
					format(coordstring6, sizeof(coordstring6), " {157DEC}Renta: {FFFFFF}-$%d\n", rent);
					format(coordstring7, sizeof(coordstring7), " {157DEC}Ukupan Kredit: {FFFFFF}$%d\n", PlayerInfo[i][pKredit]);
					if(PlayerInfo[i][pKredit] != 0)
					{
						format(coordstring8, sizeof(coordstring8), " {157DEC}Rata: {FFFFFF}%d\n", PlayerInfo[i][pAccount]);
						PlayerInfo[i][pKredit] -= 500;
						PlayerInfo[i][pAccount] -= 500;
					}
					format(payday, 512,"%s%s%s%s%s%s%s%s%s",coordstring,coordstring1,coordstring2,coordstring3,coordstring4,coordstring5,coordstring6,coordstring7,coordstring8);
				    ShowPlayerDialog(i, 667, DIALOG_STYLE_MSGBOX, "{157DEC}Payday | Placa", payday , "Uredu", "Uredu");
					format(string, sizeof(string), "~y~Plata~n~~w~Plata je stigla na vas racun");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime] += 1;
					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][pVip] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 5)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    SendClientMessage(i, COLOR_WHITE, "* Niste igrali dovoljno dugo da biste dobili platu.");
				}
			}
	}
	SaveAccounts();
	return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): //
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||

if (PlayerInfo[i][pExp] >= expamount)
				    {
		
					PlayerInfo[i][pLevel]++;
					
					SetPlayerScore(i, PlayerInfo[i][pLevel]);
				    }

Citat: Blaeks poslato April 12, 2013, 20:27:55 POSLE PODNE
if (PlayerInfo[i][pExp] >= expamount)
				    {
		
					PlayerInfo[i][pLevel]++;
					
					SetPlayerScore(i, PlayerInfo[i][pLevel]);
				    }



Pozabio sam oko payDay kamo ide
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||


ovo mi sada baca

C:\Documents and Settings\User\Desktop\Balkan Life\Balkan Life\gamemodes\BLRP.pwn(31943) : error 017: undefined symbol "targetid"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.




a ovo sam dodao jer je i za to bacalo erore

new nxtlevel = PlayerInfo[targetid][pLevel]+1;
	new expamount = nxtlevel*levelexp;
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||

stavi ovako
public PayDay()
{
	new string[128];
	new coordstring[128];
	new coordstring1[128];
	new coordstring2[128];
	new coordstring3[128];
	new coordstring4[128];
	new coordstring5[128];
	new coordstring6[128];
	new coordstring7[128];
	new coordstring8[128];
	new payday[512];
	new account,interest;
	new rent = 0;
	foreach (Player, i)
	{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    SendClientMessage(i, COLOR_LIGHTRED, "Niste uspjeli da vratite dug, idete u zatvor.");
				    GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
				    new rand = random(sizeof(gRandomJailSpawns));
					SetPlayerPos(i, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
		            PlayerInfo[i][pJailed] = 1;
		            SafeResetPlayerWeapons(i);
		            SafeResetPlayerMoney(i);
					WantedPoints[i] = 0;
					PlayerInfo[i][pJailTime] = 240;
					format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_WHITE, string);
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new tmpintrate;
				if (PlayerInfo[i][pPhousekey] != 255 && strcmp(playername2, Houses[PlayerInfo[i][pPhousekey]][hOwner], true) == 0)
				{
				    if(GetPVarInt(i, "DonatorRank")  > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//Houses[key][hLevel]
				}
				else
				{
				    if(GetPVarInt(i, "DonatorRank")  > 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] / 50;
					if(PlayerInfo[i][pVip] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 100;
					    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);
					if(respekti == 0) // Ako su iskljuceni
					{
					    PlayerInfo[i][pExp] ++; //++ Znaci da dodaje igracima 1
					}
					else // U suprotnom
					{
					    PlayerInfo[i][pExp] += 2; //+= 2 Znaci dodaje igracima 2
					}
					PlayerInfo[i][pAccount] = account+interest;
					format(coordstring, sizeof(coordstring),  " {157DEC}Plata: {FFFFFF}$%d\n {157DEC}Takse: {FFFFFF}-$%d\n", checks, TaxValue);
					if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(coordstring1, sizeof(coordstring1), " {157DEC}Racun za struju: {FFFFFF}-$%d\n", ebill);
					}
					format(coordstring2, sizeof(coordstring2), " {157DEC}Staro Stanje: {FFFFFF}$%d\n", account - checks);
					format(coordstring3, sizeof(coordstring3), " {157DEC}Kamata: {FFFFFF}0.%d posto\n",tmpintrate);
					format(coordstring4, sizeof(coordstring4), " {157DEC}Kamatni Interes: {FFFFFF}$%d\n", interest);
					format(coordstring5, sizeof(coordstring5), " {157DEC}Novo stanje: {FFFFFF}$%d\n", PlayerInfo[i][pAccount]);
					format(coordstring6, sizeof(coordstring6), " {157DEC}Renta: {FFFFFF}-$%d\n", rent);
					format(coordstring7, sizeof(coordstring7), " {157DEC}Ukupan Kredit: {FFFFFF}$%d\n", PlayerInfo[i][pKredit]);
					if(PlayerInfo[i][pKredit] != 0)
					{
						format(coordstring8, sizeof(coordstring8), " {157DEC}Rata: {FFFFFF}%d\n", PlayerInfo[i][pAccount]);
						PlayerInfo[i][pKredit] -= 500;
						PlayerInfo[i][pAccount] -= 500;
					}
					format(payday, 512,"%s%s%s%s%s%s%s%s%s",coordstring,coordstring1,coordstring2,coordstring3,coordstring4,coordstring5,coordstring6,coordstring7,coordstring8);
				    ShowPlayerDialog(i, 667, DIALOG_STYLE_MSGBOX, "{157DEC}Payday | Placa", payday , "Uredu", "Uredu");
					format(string, sizeof(string), "~y~Plata~n~~w~Plata je stigla na vas racun");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime] += 1;
					if(FarmerVar[i] == 0)
					{
						FarmerPickup[i][0] = 0;
					}
                                        if (PlayerInfo[i][pExp] >= expamount)
				        {
					PlayerInfo[i][pLevel]++;
					SetPlayerScore(i, PlayerInfo[i][pLevel]);
				        }
					if(DrugFarmerVar[i] == 0)
					{
						DrugFarmerPickup[i][0] = 0;
					}
					if(SmugglerWork[i] == 0)
					{
						PayDaySecure[i] = 0;
					}
					if(PlayerInfo[i][pVip] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 5)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    SendClientMessage(i, COLOR_WHITE, "* Niste igrali dovoljno dugo da biste dobili platu.");
				}
			}
	}
	SaveAccounts();
	return 1;
}

sad opet ovo baca

C:\Documents and Settings\User\Desktop\Balkan Life\Balkan Life\gamemodes\BLRP.pwn(32037) : error 017: undefined symbol "expamount"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||

pa pazi, ja ne znam kako je tebi definisana granica levela, mislim  broj popunjenih respekta, to izmeni kako je tebi

Citat: Blaeks poslato April 13, 2013, 13:54:06 POSLE PODNE
pa pazi, ja ne znam kako je tebi definisana granica levela, mislim  broj popunjenih respekta, to izmeni kako je tebi

Di mogu to vidit ?
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||


if (strcmp(cmd, "/levelup", true) == 0 || strcmp(cmd, "/kupilevel", 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[128];
					/*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, "Treba vam %d Respekt Poena,trenutno imate [%d]!",expamount,PlayerInfo[playerid][pExp]);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						return 1;
					}
					else
					{
						format(string, sizeof(string), "~g~VECI NIVO~n~~w~Sada ste level %d", nxtlevel);
						PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
						/*GivePlayerCash(playerid, (-costlevel));*/
						PlayerInfo[playerid][pLevel]++;
						if(PlayerInfo[playerid][pVip] > 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, "Kupili ste level %d Kucajte /nadogradnjda", nxtlevel);
						SendClientMessage(playerid, COLOR_GRAD1, infostring);
						format(infostring, 256, "Imate %d nepotrosenih Upgrade Poena",PlayerInfo[playerid][gPupgrade]);
						SendClientMessage(playerid, COLOR_GRAD2, infostring);
					}
				}
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Niste prijavljeni!");
			}
		}
		return 1;
	}


st mi od tud treba ?
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||


ali zas ovo ond baca

C:\Documents and Settings\User\Desktop\Balkan Life\Balkan Life\gamemodes\BLRP.pwn(31468) : error 017: undefined symbol "expamount"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||

stavi ovako iznad toga
new nxtlevel = PlayerInfo[i][pLevel]+1;
	                new expamount = nxtlevel*levelexp;

Moze lock ok je sad radi
Trazimo Mapera Koji zna sto radi,koji je ozbiljan i da mi posalje neke radove na pm i koliko je spreman vremena dnevno odvojiti na mapanje.||Nagrada 1337 Admin||