Jump to content

Mr.Big

Membru
  • Posts

    97
  • Joined

  • Last visited

    Never

Posts posted by Mr.Big

  1. Am un sistem de texte 3d , dar problema este ca nu mi se salveaza daca dau /edit , /buyhouse , etc , pur si simplu nu mi se modifica.Sistemul l-am pus de pe alt gm , unde merge perfect dar la mine nu.

    Am un timer , cum e si in celalalt gm , la acest public:

    public Custom3D()
    {
    	new Float:oldposx, Float:oldposy, Float:oldposz;
    	//new string[256];
    	for(new i = 0; i < MAX_PLAYERS; i++)
    	{
    		if(IsPlayerConnected(i))
    		{
    			GetPlayerPos(i, oldposx, oldposy, oldposz);
    			if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
    			{
    				for(new h = 0; h < sizeof(HouseInfo); h++)
    				{
    					if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
    					{
    						if(HouseInfo[h][hOwned] == 0)
    		                 {
    			             new string2[999];
    			             Delete3DTextLabel(housesale[h]);
    			             format(string2, sizeof(string2), "Casa de vanzare!\n Pret: $%d \n Descriere:%s \n Level:%d",HouseInfo[h][hValue],HouseInfo[h][hDiscription],HouseInfo[h][hLevel]);
    			             housesale[h] = Create3DTextLabel(string2,COLOR_BARZINI,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,15,0,1);
    		                 }
    		                if(HouseInfo[h][hOwned] == 1)
    		                {
                             new string3[999];
                            if(HouseInfo[h][hRentabil] == 0)
                             {
                             Delete3DTextLabel(housecumparat[h]);
    			             format(string3, sizeof(string3), "Casa cumparata!\nProprietar:%s\nLevel:%d\nDescriere:%s",HouseInfo[h][hOwner],HouseInfo[h][hLevel],HouseInfo[h][hDiscription]);
    		                 housecumparat[h] = Create3DTextLabel(string3,COLOR_BARZINI,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,15,0,1);
    		                 }
    			            if(HouseInfo[h][hRentabil] == 1)
    			             {
    			             Delete3DTextLabel(housecumparat[h]);
      	                     format(string3, sizeof(string3), "Casa cumparata!\nProprietar:%s\nLevel:%d\nDescriere:%s\nRent:%d$\nScrie /rentroom ca sa te cazezi",HouseInfo[h][hOwner],HouseInfo[h][hLevel],HouseInfo[h][hDiscription],HouseInfo[h][hRent]);
    		                 housecumparat[h] = Create3DTextLabel(string3,COLOR_BARZINI,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,15,0,1);
    			             }
                   	       }
    			  		}
    		  		}
    	  			for(new h = 0; h < sizeof(BizzInfo); h++)
    				{
    					if(BizzInfo[h][bOwned] == 0)
    		            {
    			          new string4[999];
    			          Delete3DTextLabel(bizsale[h]);
    			          format(string4, sizeof(string4), "%s\nAfacere de vanzare!\nPret:$%d\nScrie /buybiz ca sa cumperi!",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice]);
    			          bizsale[h] = Create3DTextLabel(string4,COLOR_BLUE,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.5,15,0,1);
    		            }
    		           if(BizzInfo[h][bOwned] == 1)
    		           {
                         new string5[999];
                         Delete3DTextLabel(bizcumparat[h]);
    			         format(string5, sizeof(string5), "%s\nProprietar:%s\nExtortion:%s\nIntrare:%d$\nScrie /enter ca sa intri",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost]);
    			         bizcumparat[h] = Create3DTextLabel(string5,COLOR_BLUE,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.5,15,0,1);
    		           }
    				}
    				for(new h = 0; h < sizeof(SBizzInfo); h++)
    				{
    					if(SBizzInfo[h][sbOwned] == 0)
    		            {
                         new string6[999];
                         Delete3DTextLabel(sbizsale[h]);
    			         format(string6, sizeof(string6), "%s\nAfacere de vanzare!\nPret:$%d",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice]);
    			         sbizsale[h] = Create3DTextLabel(string6,COLOR_BLUE,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+0.5,15,0,1);
    			        }
    		            if(SBizzInfo[h][sbOwned] == 1)
    		            {
                         new string7[999];
                         Delete3DTextLabel(sbizcumparat[h]);
                         format(string7, sizeof(string7), "%s\nProprietar:%s\nExtortion:%s\nIntrare:%d$",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost]);
    		           	 sbizcumparat[h] = Create3DTextLabel(string7,COLOR_BLUE,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+0.5,15,0,1);
    		            }
    				}
    			}
    		}
    	}
    	return 1;
    }

  2. 1)Am un sistem simplu la case de 3d TExt , si m-am gandit sa il fac mai complex. Rezultat ? Nu mai apare de loc

    if(HouseInfo[h][hOwned] == 1)
    		{
     			//CreateMapIcon(32, 0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
    			if(HouseInfo[h][hRentabil] == 0)
    			{
    				format(string, sizeof(string), "Owned:%s \n Level:%d",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
    				housecumparat = Create3DTextLabel(string,COLOR_YELLOW, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]+1,10.0,0);
    			}
    			if(HouseInfo[h][hRentabil] == 1)
    			{
    				format(string, sizeof(string), "Owned:%s \n Rent:%d$ \n Level:%d \n Type/rentroom \n To rent a room",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
    				housecumparat = Create3DTextLabel(string,COLOR_YELLOW, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]+1,10.0,0);
    			}
    	    }
    	    if(HouseInfo[h][hOwned] == 0)
    	    {
    	        format(string, sizeof(string), "House is for sale ! \n Discription: %s \n Cost:%d$ \n Level: %d \n To buy this house \n type /buyhouse",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
    	        housesale = Create3DTextLabel(string,COLOR_YELLOW, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]+1,10.0,0);
    	    }

    2) Am un sistem de gungame , iar event-ul se sfarseste dupa un timer.

    As vrea sa se sfarseasca dupa ce nu mai e niciun player din echipa adeversa.

    Echipele sunt : PlayerGunGameSpawn[playerid] = 1 ; PlayerGunGameSpawn[playerid] = 2;

  3. Simplu.

    new PlayerInWar[MAX_PLAYERS];
    public OnPlayerConnect()
    
    pui sub : PlayerInWar[playerid] = 0;
    
    apoi daca e la war ii da valoarea 1
    
    if(War == 1) sa zicem...
    PlayerInWar[playerid] = 1;
    
    La OnPlayerDeath , pui PlayerInWar[playerid] = 0;

    E doar un exemplu , daca pui si /war til fac mai personalizat

  4. Am incercat sa fac o comanda cu care liderul sa poata vedea toti membrii factiuni lui si nu mi-a iesit, imi puteti spune de ce?

    [pawn]

    if(strcmp(cmd, "/allmember", true) == 0)

    {

            if(PlayerInfo[playerid][pLeader] == 0) { return SendClientMessage(playerid, COLOR_LIGHTRED, "Tu nu esti lider !");}

            new string2[64];

            for(new i = 0; i < MAX_PLAYER_NAME; i++)

    {

          format(string2, sizeof(string2), "LARP/Users/%s.ini", i);

    if(PlayerInfo[playerid][pLeader] == dini_Int(string2,"Member"))

    {

          format(string, 256, "Membrul: %d",string2);

          SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

    }

    }

    return 1;

    }

    [/pawn]

    1. In scriptfiles ai LARP/Users? sau /users? . Daca ai users , pune doar USERS/%s.ini

    2. Dupa if-ul cu membrul , cred ca trebuia sa pui iar dini_int , nu ma pricep la dini , scuze...

  5. comanda ta de /unban e praf rau . Cum sa ii dea pBan la playerid cand playerid nu e pe server ? =))

    Uite , te ajut iar :

    [pawn] format(string, sizeof(string), "users/%s.ini", tmp);

      new File:hFile = fopen(string, io_read);//new File: hFile = fopen(string, io_append);

      if (hFile)

      {

          new Data[ 256 ],val [ 256 ];

      while ( fread( hFile , Data , sizeof( Data ) ) )

      if( strcmp( ini_GetKey( Data ) , "Locked" , true ) == 0 )val = ini_GetValue( Data );

      if(strval( val ) == 1)

      {

        new var[64];

      format(var, sizeof(var), "Locked=1\n");

      //fdeleteline(string,var);

      fclose(hFile);hFile = fopen(string, io_append);

      format(var, 64, "Locked=0\n");

      fwrite(hFile, var);

      fclose(hFile);[/pawn] Ti-am dat ce era important , nu iti dau tot scriptul

  6. Pune asa :

    [pawn]format(coordsstring, sizeof(coordsstring), "House key:[%d] Business key:[%d] Veh1:[%d] Veh2:[%d] Veh3:[%d] HireKey:[%d] int:[%d] virworld:[%d] local:[%d]", housekey,bizkey,carkey,carkey2,carkey3,HireCar[targetid],intir,virworld,local);

    [/pawn]

    si , sus defineste:

    [pawn]

    new carkey2 = PlayerInfo[targetid][PCarKey2]

    new carkey3 = PlayerInfo[targetid][PCarKey3]

    [/pawn]

    In loc de pcarkey2 de exemplu pune cum ai tu la veh1 ...

  7. Incerc de mult timp sa remediez acest bug , dar tot nu stiu cum... apelez la voi , daca stiti . Daca merge un player pe langa gara sau langa banca , acesta va lua un warning de acest fel:

    [pawn]Warning(opcode 0x6E7): Exception 0xC0000005 at 0x7F0BF7[/pawn]

    De fapt , ia 2 warninguri , si va dati seama ca daca vine de mai multe ori ia crash... stie cineva?..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.