SAMP Bug?
#1

Код HTML:
if(KosenjeTrave[playerid] == 1) //Checking is player working
		{
			new Float:tX, Float:tY, Float:tZ;
			for(new i = 0; i < 28; i++)
			{
				if(PokosioTrave[playerid] == 28) //This is what we are incerasing (++;)
				{
					//todo
				}
				else
				{
					GetPlayerObjectPos(playerid, obj_KosacTrava[i][playerid], tX, tY, tZ); //If is player in range of these, he will get it incerased
					if(IsPlayerInRangeOfPoint(playerid, 3.0, tX, tY, tZ))
					{
						DestroyPlayerObject(playerid, obj_KosacTrava[i][playerid]);
						obj_KosacTrava[i][playerid] = 1; //ITs changing object to non-object value so it cannot be again used
						obj_KosacTravaPokosena[i][playerid] = CreatePlayerObject(playerid, 826, tX, tY, tZ, 0.0, 0.0, 0.0); //This is creating new object on old one's place
						PokosioTrave[playerid] += 1; //This is what we are incerasing
						Job(playerid, "Odlicno Vam ide! Preostalo objekata trave: %d.", 28-PokosioTrave[playerid]); //Message
						printf("Igrac sada ima %d trave", PokosioTrave[playerid]); //debug
					}
					else if(!IsPlayerInRangeOfPoint(playerid, 3.0, tX, tY, tZ))
					{
						print("Igrac nije kod objekta"); //Showing is player in range of that object
					}
				}
			}
		}
So basically i need to incerase that value for +1, its working fine on start, but after 4-5 times when player do that action (this is job system) value is incerasing for 2 to 5 (random) and on random place.
Help, look at time stamp, here is InGame msg
https://imgur.com/a/Qewyv
(( This attached object is just random cords, don't look at it xD )
Reply
#2

Pls write your code in english, its like unversal language for coding.
Reply
#3

I advice you to don't make multiple arrays for a single system until it's really necessary. Use an enum with a single array.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)