[Pomoc] Sačuvavanje oružja ( INI )


Započeo sch, Jul 30, 2013, 13:15:32 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

sch

*

Skripta koju koristim: Central Town ( UP edit )
Detaljan opis problema: Skripta koju koristim nije imala system sačuvavanja oružja tijekom kada igrač ode offline,sada sam to napravio. System sam izvadio iz skripte u kojoj to savrÅ¡eno radi takoÄ'e radi u INI sačuvavanju i na toj skripti sve perfektno radi i daje gun kako treba ionoliko kolko ima  on tako mu i sačuva nikad neda duplo nit manje,dok meni prilikon OnPlayerDisconect municiju oružja udvostruči + upiÅ¡e u neki drugi Slot da ima i tu oružja a tu ga opÅ¡te nema ,kada se spawnam sve mi da oružja onoliko kolko mi piÅ¡e u fajlu,to ispravno radi,samo kada odem OnPlayerDisconnect on mi udvostruči oružje + mi doda na neki novi Weapon.Prilažem dolje sve Å¡to je potrebno...
Dio skripte:
PRIJESAÄŒUVAVANJA:
Oruzje1 = 0
Oruzje2 = 0
Oruzje3 = 0
Oruzje4 = 0
Oruzje5 = 0
Oruzje6 = 0
Oruzje7 = 0
Oruzje8 = 0
Oruzje9 = 0
Oruzje10 = 0
Oruzje11 = 0
Oruzje12 = 0
Municija1 = 0
Municija2 = 0
Municija3 = 0
Municija4 = 0
Municija5 = 0
Municija6 = 0
Municija7 = 0
Municija8 = 0
Municija9 = 0
Municija10 = 0
Municija11 = 0
Municija12 = 0


KADA UZMEM AK47 sa 300 metaka i odem Quitgame:
Oruzje1 = 0
Oruzje2 = 0
Oruzje3 = 0
Oruzje4 = 0
Oruzje5 = 0
Oruzje6 = 30
Oruzje7 = 0
Oruzje8 = 0
Oruzje9 = 0
Oruzje10 = 0
Oruzje11 = 0
Oruzje12 = 0
Municija1 = 600
Municija2 = 600
Municija3 = 0
Municija4 = 0
Municija5 = 0
Municija6 = 600
Municija7 = 0
Municija8 = 0
Municija9 = 0
Municija10 = 0
Municija11 = 0
Municija12 = 600


SAVEPLAYER:
stock SavePlayer(playerid)
{
    if(UlogovanProvera[playerid] == 1)
	{
	    new INI:File = INI_Open(Korisnici(playerid));
	    INI_SetTag(File,"data");
		INI_WriteInt(File,"NovacDzep",PlayerInfo[playerid][pNovacDzep]);
	    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	    INI_WriteInt(File,"Ubistava",PlayerInfo[playerid][pUbistava]);
	    INI_WriteInt(File,"Smrti",PlayerInfo[playerid][pSmrti]);
	    INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
	    INI_WriteInt(File,"GameMaster",PlayerInfo[playerid][pGM]);
	    INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
	    INI_WriteInt(File,"Godine",PlayerInfo[playerid][pGodine]);
	    INI_WriteInt(File,"Drzava",PlayerInfo[playerid][pDrzava]);
	    INI_WriteInt(File,"Pol",PlayerInfo[playerid][pSex]);
	    INI_WriteInt(File,"Tutorial",PlayerInfo[playerid][pTutorial]);
	    INI_WriteString(File,"Email",PlayerInfo[playerid][pEmail]);
	    INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLider]);
	    INI_WriteInt(File,"Clan",PlayerInfo[playerid][pClan]);
	    INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
	    INI_WriteInt(File,"Mutiran",PlayerInfo[playerid][pMutiran]);
	    INI_WriteInt(File,"NovacBanka",PlayerInfo[playerid][pNovacBanka]);
	    INI_WriteInt(File,"Warn",PlayerInfo[playerid][pWarn]);
	    INI_WriteInt(File,"BankovniRacun",PlayerInfo[playerid][pBankovniRacun]);
	    INI_WriteInt(File,"Zatvor",PlayerInfo[playerid][pZatvor]);
	    INI_WriteInt(File,"ZatvorenVreme",PlayerInfo[playerid][pZatvorenVreme]);
	    INI_WriteInt(File,"Respekti",PlayerInfo[playerid][pExp]);
	    INI_WriteInt(File,"UhapsenPuta",PlayerInfo[playerid][pUhapsenPuta]);
	    INI_WriteInt(File,"Droga",PlayerInfo[playerid][pDroga]);
	    INI_WriteInt(File,"Mats",PlayerInfo[playerid][pMats]);
	    INI_WriteInt(File,"PayDayPoeni",PlayerInfo[playerid][pPayDayPoeni]);
	    INI_WriteInt(File,"SatiIgre",PlayerInfo[playerid][pSatiIgre]);
	    INI_WriteInt(File,"IznosRate",PlayerInfo[playerid][pIznosRate]);
	    INI_WriteInt(File,"IznosKredita",PlayerInfo[playerid][pIznosKredita]);
	    INI_WriteInt(File,"PreostaloZaOtplatu",PlayerInfo[playerid][pPreostaloZaOtplatu]);
	    INI_WriteInt(File,"ADozvola",PlayerInfo[playerid][pADozvola]);
	    INI_WriteInt(File,"KamionDozvola",PlayerInfo[playerid][pKamionDozvola]);
	    INI_WriteInt(File,"AvionDozvola",PlayerInfo[playerid][pAvionDozvola]);
	    INI_WriteInt(File,"MotorDozvola",PlayerInfo[playerid][pMotorDozvola]);
	    INI_WriteInt(File,"BrodDozvola",PlayerInfo[playerid][pBrodDozvola]);
	    INI_WriteInt(File,"GunDozvola",PlayerInfo[playerid][pGunDozvola]);
	    INI_WriteInt(File,"PosedovanjeFirme",PlayerInfo[playerid][pPosedovanjeFirme]);
	    INI_WriteInt(File,"Mobilni",PlayerInfo[playerid][pMobilni]);
	    INI_WriteInt(File,"Imenik",PlayerInfo[playerid][pImenik]);
	    INI_WriteInt(File,"MobKredit",PlayerInfo[playerid][pMobKredit]);
	    INI_WriteInt(File,"Cigare",PlayerInfo[playerid][pCigare]);
	    INI_WriteInt(File,"Upaljac",PlayerInfo[playerid][pUpaljac]);
	    INI_WriteInt(File,"Kanap",PlayerInfo[playerid][pKanap]);
	    INI_WriteInt(File,"Naocare",PlayerInfo[playerid][pNaocare]);
	    INI_WriteInt(File,"Sat",PlayerInfo[playerid][pSat]);
	    INI_WriteInt(File,"BorbeniStil",PlayerInfo[playerid][pBorbeniStil]);
	    INI_WriteInt(File,"Posao",PlayerInfo[playerid][pPosao]);
	    INI_WriteInt(File,"Hrana",PlayerInfo[playerid][pHrana]);
	    INI_WriteInt(File,"PosedovanjeKuce",PlayerInfo[playerid][pPosedovanjeKuce]);
    	INI_WriteInt(File,"ProveraSpawna",PlayerInfo[playerid][pProveraSpawna]);
    	INI_WriteInt(File,"Rent",PlayerInfo[playerid][pRent]);
    	INI_WriteInt(File,"PosedovanjeStana",PlayerInfo[playerid][pPosedovanjeStana]);
    	INI_WriteInt(File,"PosedovanjeVikendice",PlayerInfo[playerid][pPosedovanjeVikendice]);
    	INI_WriteInt(File,"OrgUgovor",PlayerInfo[playerid][pKaznaUgovor]);
    	INI_WriteInt(File,"PosaoUgovor",PlayerInfo[playerid][pPosaoUgovor]);
    	INI_WriteInt(File,"PosedovanjeAuta",PlayerInfo[playerid][pPosedovanjeAuta]);
    	INI_WriteInt(File,"DzeparosVreme",PlayerInfo[playerid][pDzeparosVreme]);
    	INI_WriteInt(File,"PosedovanjeMotora",PlayerInfo[playerid][pPosedovanjeMotora]);
    	INI_WriteInt(File,"Kaciga",PlayerInfo[playerid][pKaciga]);
    	INI_WriteInt(File,"PosedovanjeBicikla",PlayerInfo[playerid][pPosedovanjeBicikla]);
    	INI_WriteInt(File,"PosedovanjeAviona", PlayerInfo[playerid][pPosedovanjeAviona]);
    	INI_WriteInt(File,"PosedovanjePlovila", PlayerInfo[playerid][pPosedovanjePlovila]);
    	INI_WriteInt(File,"DonatorBodovi", PlayerInfo[playerid][pDonatorBodovi]);
    	INI_WriteInt(File,"Promoter", PlayerInfo[playerid][pPromoter]);
    	INI_WriteInt(File,"Vip", PlayerInfo[playerid][pVip]);
    	INI_WriteInt(File,"LottoBr", PlayerInfo[playerid][pLottoNr]);
    	INI_WriteInt(File,"LottoBr2", PlayerInfo[playerid][pLottoNr2]);
    	INI_WriteInt(File,"LottoBr3", PlayerInfo[playerid][pLottoNr3]);
		INI_WriteInt(File,"LottoBr4", PlayerInfo[playerid][pLottoNr4]);
    	INI_WriteInt(File,"LottoBr5", PlayerInfo[playerid][pLottoNr5]);
    	INI_WriteInt(File,"LottoBr6", PlayerInfo[playerid][pLottoNr6]);
    	INI_WriteInt(File,"LottoBr7", PlayerInfo[playerid][pLottoNr7]);
    	INI_WriteInt(File, "Oruzje1", PlayerInfo[playerid][Oruzje][0]);
		INI_WriteInt(File, "Oruzje2", PlayerInfo[playerid][Oruzje][1]);
		INI_WriteInt(File, "Oruzje3", PlayerInfo[playerid][Oruzje][2]);
		INI_WriteInt(File, "Oruzje4", PlayerInfo[playerid][Oruzje][3]);
		INI_WriteInt(File, "Oruzje5", PlayerInfo[playerid][Oruzje][4]);
		INI_WriteInt(File, "Oruzje6", PlayerInfo[playerid][Oruzje][5]);
		INI_WriteInt(File, "Oruzje7", PlayerInfo[playerid][Oruzje][6]);
		INI_WriteInt(File, "Oruzje8", PlayerInfo[playerid][Oruzje][7]);
		INI_WriteInt(File, "Oruzje9", PlayerInfo[playerid][Oruzje][8]);
		INI_WriteInt(File, "Oruzje10", PlayerInfo[playerid][Oruzje][9]);
		INI_WriteInt(File, "Oruzje11", PlayerInfo[playerid][Oruzje][10]);
		INI_WriteInt(File, "Oruzje12", PlayerInfo[playerid][Oruzje][11]);
		INI_WriteInt(File, "Municija1", PlayerInfo[playerid][Metci][0]);
		INI_WriteInt(File, "Municija2", PlayerInfo[playerid][Metci][1]);
		INI_WriteInt(File, "Municija3", PlayerInfo[playerid][Metci][2]);
		INI_WriteInt(File, "Municija4", PlayerInfo[playerid][Metci][3]);
		INI_WriteInt(File, "Municija5", PlayerInfo[playerid][Metci][4]);
		INI_WriteInt(File, "Municija6", PlayerInfo[playerid][Metci][5]);
		INI_WriteInt(File, "Municija7", PlayerInfo[playerid][Metci][6]);
		INI_WriteInt(File, "Municija8", PlayerInfo[playerid][Metci][7]);
		INI_WriteInt(File, "Municija9", PlayerInfo[playerid][Metci][8]);
		INI_WriteInt(File, "Municija10", PlayerInfo[playerid][Metci][9]);
		INI_WriteInt(File, "Municija11", PlayerInfo[playerid][Metci][10]);
		INI_WriteInt(File, "Municija12", PlayerInfo[playerid][Metci][11]);
		INI_Close(File);
	}
	return 1;
}


ONPLAYERDISCONECT:

public OnPlayerDisconnect(playerid, reason)
{
    if(playerid == -1) return 1;
    if(AdminVozilo[playerid] != -1) DestroyVehicle(AdminVozilo[playerid]), AdminVozilo[playerid] = -1;
    /////////////////////////////////////////////////////
    if(Rentano[playerid] != 299) { SetVehicleToRespawn(Rentano[playerid]); Rentano[playerid] = 299; }
	//////////////////////////////////////////////
	KillTimer(IntroTimer[playerid]); KillTimer(IntroTimer2[playerid]);
    KillTimer(IntroTimer3[playerid]); KillTimer(IntroTimer4[playerid]);
    KillTimer(IntroTimer5[playerid]); KillTimer(LogRegTimer[playerid]);
    KillTimer(MobilniCenaRazgovora[playerid]); AttachObjectRemove(playerid);
    KillTimer(DobivaNovacTimer[playerid]);
    VuceIgraca[playerid] = -1; KillTimer(VuciTimer[playerid]);
	///////////////////////////////////////////////
	if(Prepreka1Kreirana[playerid] == true) DestroyObject(Prepreka1[playerid]);
	if(Prepreka2Kreirana[playerid] == true) DestroyObject(Prepreka2[playerid]);
	if(Prepreka3Kreirana[playerid] == true) DestroyObject(Prepreka3[playerid]);
	if(Prepreka4Kreirana[playerid] == true) DestroyObject(Prepreka4[playerid]);
	if(KupovinaAuta[playerid] == true) autokatalog = 0;
	//////////////////////////////////////////////
    if(PlayerInfo[playerid][pTrazeniLevel] > 0 || StavljeneLisice[playerid] > 0 || IgracTazovan[playerid] > 0) //Zavezan[playerid] > 0
	{
		PlayerInfo[playerid][pZatvor] = 2;
		PlayerInfo[playerid][pZatvorenVreme] = PlayerInfo[playerid][pTrazeniLevel] * 300;
	    PlayerInfo[playerid][pTrazeniLevel] = 0;
	    SetPlayerPos(playerid, 107.2300,1920.6311,18.5208);
		SetPlayerWorldBounds(playerid, 337.5694,101.5826,1940.9759,1798.7453);
		SetPlayerInterior(playerid,0);
		VuceIgraca[playerid] = -1;
		SetPlayerColor(playerid, BELA2);
		KillTimer(VuciTimer[playerid]);
	}
	///////////////////
	foreach(Player, i)
	{
		if(hPrihvatio[i] == playerid)
		{
			hPrihvatio[i] = -1;
		 	GameTextForPlayer(i, "~r~Pozivalac napustio igru", 5000, 1);
			DisablePlayerCheckpoint(i);
		}
		//if(IgracPosmatraIgraca[i] == playerid) cmd_uncon(i, "");
	}
	//////////////////////////////////////////
	if(Zavezan[playerid] >= 1) { g_NovacMinus(playerid, 20000); SCM(playerid, -1, ""ROZA"Izgubili ste 20000$ jer ste otisli offline tokom vezanja (/zavezi)"); Zavezan[playerid] = 0; }
	////////////////////////////////////////////
	if(TelefonRazgovor[playerid] != -1 && TelefonZvoni[playerid] == false)
	{
		SCM(TelefonRazgovor[playerid], -1, "CT:RP Telecom | "C_ZUTA"Igrac sa kojim ste pricali je izasao sa servera!");
		SetPlayerSpecialAction(TelefonRazgovor[playerid], SPECIAL_ACTION_STOPUSECELLPHONE);
		RemovePlayerAttachedObject(TelefonRazgovor[playerid], TELEFON_SLOT);
		SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
		RemovePlayerAttachedObject(playerid, TELEFON_SLOT);
		TelefonRazgovor[TelefonRazgovor[playerid]] = -1,
		TelefonRazgovor[playerid] = -1;
	}
	///////////////////////////////////////////
	new rstring[120];
	switch(reason)
	{
		case 0: format(rstring, sizeof(rstring), ""SIVA"(( %s je izasao sa servera... (crash) ))", GetName(playerid));
		case 1: format(rstring, sizeof(rstring), ""SIVA"(( %s je izasao sa servera... ))", GetName(playerid));
		case 2: format(rstring, sizeof(rstring), ""SIVA"(( %s je izasao sa servera "CRVENA"(KICK/BAN)"SIVA"... ))", GetName(playerid));
	}
	ProxDetector(30.0, playerid, rstring,PROX,PROX,PROX,PROX,PROX);
	//////////////////////////////////////////
	if(Posadjena[playerid] >= 1 || BranjeDroge[playerid] >= 1)
	{
		KillTimer(GroveDrogaTimer[playerid]); BranjeDroge[playerid] = 0; Posadjena[playerid] = 0;
	    DestroyPlayerObject(playerid, SadjenjeDrogeGrove[0][playerid]); DestroyPlayerObject(playerid, SadjenjeDrogeGrove[1][playerid]);
		DestroyPlayerObject(playerid, SadjenjeDrogeGrove[2][playerid]); DestroyPlayerObject(playerid, SadjenjeDrogeGrove[3][playerid]);
	}
	//////////////////////////////////////////////////////////
	if(MehPozivalac == playerid) MehPozivalac = -1;
	//////////////////////////////////////////
	SavePlayer(playerid);
	//////////////////////////////////////////////
    return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Pawn Scripting Arbaiter
Willfried Schafer

sch

*

**BUMP**
Zna li mi netko pomoć?
Pawn Scripting Arbaiter
Willfried Schafer