Jump to content
  • 0
Sign in to follow this  
Jizzy.

Problema functie

Question

Salut, am si eu o problema cu o functie din gamemode. Am adaugat prinft la aceasta functie ca sa vad si eu daca totul este ok si am observat ca are o problema pe care nu stiu cum sa o rezolv si am decis sa fac un topic aici. Aceasta este functia: 

function IsAnOwnableCar(vehicleid)
{
	foreach(Player, i)
	{
		for(new v; v < MAX_PERSONAL_VEHICLES; v++)
		{
			if(PlayerInfo[i][pCarID][v] == vehicleid)
			{
				return 1;
			}
			printf("%d playerid, %d carid IsAnOwnableCar", i, v);
		}
	}
	return 0;
}	

 Am verificat si error_log si este plin de spam 

[19:41:09] 0 playerid, 6 carid IsAnOwnableCar
[19:41:09] 0 playerid, 7 carid IsAnOwnableCar
[19:41:09] 0 playerid, 8 carid IsAnOwnableCar
[19:41:09] 0 playerid, 9 carid IsAnOwnableCar
[19:41:09] 1 playerid, 0 carid IsAnOwnableCar
[19:41:09] 1 playerid, 1 carid IsAnOwnableCar
[19:41:09] 1 playerid, 2 carid IsAnOwnableCar
[19:41:09] 1 playerid, 3 carid IsAnOwnableCar
[19:41:09] 1 playerid, 4 carid IsAnOwnableCar
[19:41:09] 1 playerid, 5 carid IsAnOwnableCar
[19:41:09] 1 playerid, 6 carid IsAnOwnableCar
[19:41:09] 1 playerid, 7 carid IsAnOwnableCar
[19:41:09] 1 playerid, 8 carid IsAnOwnableCar
[19:41:09] 1 playerid, 9 carid IsAnOwnableCar
[19:41:10] 0 playerid, 0 carid IsAnOwnableCar
[19:41:10] 0 playerid, 1 carid IsAnOwnableCar
[19:41:10] 0 playerid, 2 carid IsAnOwnableCar
[19:41:10] 0 playerid, 3 carid IsAnOwnableCar
[19:41:10] 0 playerid, 4 carid IsAnOwnableCar
[19:41:10] 0 playerid, 5 carid IsAnOwnableCar
[19:41:10] 0 playerid, 6 carid IsAnOwnableCar
[19:41:10] 0 playerid, 7 carid IsAnOwnableCar
[19:41:10] 0 playerid, 8 carid IsAnOwnableCar
[19:41:10] 0 playerid, 9 carid IsAnOwnableCar
[19:41:10] 1 playerid, 0 carid IsAnOwnableCar
[19:41:10] 1 playerid, 1 carid IsAnOwnableCar
[19:41:10] 1 playerid, 2 carid IsAnOwnableCar
[19:41:10] 1 playerid, 3 carid IsAnOwnableCar
[19:41:10] 1 playerid, 4 carid IsAnOwnableCar
[19:41:10] 1 playerid, 5 carid IsAnOwnableCar
[19:41:10] 1 playerid, 6 carid IsAnOwnableCar
[19:41:10] 1 playerid, 7 carid IsAnOwnableCar
[19:41:10] 1 playerid, 8 carid IsAnOwnableCar
[19:41:10] 1 playerid, 9 carid IsAnOwnableCar
[19:41:11] 0 playerid, 0 carid IsAnOwnableCar
[19:41:11] 0 playerid, 1 carid IsAnOwnableCar
[19:41:11] 0 playerid, 2 carid IsAnOwnableCar
[19:41:11] 0 playerid, 3 carid IsAnOwnableCar
[19:41:11] 0 playerid, 4 carid IsAnOwnableCar
[19:41:11] 0 playerid, 5 carid IsAnOwnableCar
[19:41:11] 0 playerid, 6 carid IsAnOwnableCar
[19:41:11] 0 playerid, 7 carid IsAnOwnableCar
[19:41:11] 0 playerid, 8 carid IsAnOwnableCar
[19:41:11] 0 playerid, 9 carid IsAnOwnableCar
[19:41:11] 1 playerid, 0 carid IsAnOwnableCar
[19:41:11] 1 playerid, 1 carid IsAnOwnableCar
[19:41:11] 1 playerid, 2 carid IsAnOwnableCar
[19:41:11] 1 playerid, 3 carid IsAnOwnableCar
[19:41:11] 1 playerid, 4 carid IsAnOwnableCar
[19:41:11] 1 playerid, 5 carid IsAnOwnableCar
[19:41:11] 1 playerid, 6 carid IsAnOwnableCar
[19:41:11] 1 playerid, 7 carid IsAnOwnableCar
[19:41:11] 1 playerid, 8 carid IsAnOwnableCar
[19:41:11] 1 playerid, 9 carid IsAnOwnableCar
[19:41:12] 0 playerid, 0 carid IsAnOwnableCar
[19:41:12] 0 playerid, 1 carid IsAnOwnableCar
[19:41:12] 0 playerid, 2 carid IsAnOwnableCar
[19:41:12] 0 playerid, 3 carid IsAnOwnableCar
[19:41:12] 0 playerid, 4 carid IsAnOwnableCar
[19:41:12] 0 playerid, 5 carid IsAnOwnableCar
[19:41:12] 0 playerid, 6 carid IsAnOwnableCar
[19:41:12] 0 playerid, 7 carid IsAnOwnableCar
[19:41:12] 0 playerid, 8 carid IsAnOwnableCar
[19:41:12] 0 playerid, 9 carid IsAnOwnableCar
[19:41:12] 1 playerid, 0 carid IsAnOwnableCar
[19:41:12] 1 playerid, 1 carid IsAnOwnableCar
[19:41:12] 1 playerid, 2 carid IsAnOwnableCar
[19:41:12] 1 playerid, 3 carid IsAnOwnableCar
[19:41:12] 1 playerid, 4 carid IsAnOwnableCar
[19:41:12] 1 playerid, 5 carid IsAnOwnableCar
[19:41:12] 1 playerid, 6 carid IsAnOwnableCar
[19:41:12] 1 playerid, 7 carid IsAnOwnableCar
[19:41:12] 1 playerid, 8 carid IsAnOwnableCar
[19:41:12] 1 playerid, 9 carid IsAnOwnableCar
[19:41:14] 0 playerid, 0 carid IsAnOwnableCar
[19:41:14] 0 playerid, 1 carid IsAnOwnableCar
[19:41:14] 0 playerid, 2 carid IsAnOwnableCar
[19:41:14] 0 playerid, 3 carid IsAnOwnableCar
[19:41:14] 0 playerid, 4 carid IsAnOwnableCar
[19:41:14] 0 playerid, 5 carid IsAnOwnableCar
[19:41:14] 0 playerid, 6 carid IsAnOwnableCar
[19:41:14] 0 playerid, 7 carid IsAnOwnableCar
[19:41:14] 0 playerid, 8 carid IsAnOwnableCar
[19:41:14] 0 playerid, 9 carid IsAnOwnableCar
[19:41:14] 1 playerid, 0 carid IsAnOwnableCar
[19:41:14] 1 playerid, 1 carid IsAnOwnableCar
[19:41:14] 1 playerid, 2 carid IsAnOwnableCar
[19:41:14] 1 playerid, 3 carid IsAnOwnableCar
[19:41:14] 1 playerid, 4 carid IsAnOwnableCar
[19:41:14] 1 playerid, 5 carid IsAnOwnableCar
[19:41:14] 1 playerid, 6 carid IsAnOwnableCar
[19:41:14] 1 playerid, 7 carid IsAnOwnableCar
[19:41:14] 1 playerid, 8 carid IsAnOwnableCar
[19:41:14] 1 playerid, 9 carid IsAnOwnableCar
[19:41:15] 0 playerid, 0 carid IsAnOwnableCar
[19:41:15] 0 playerid, 1 carid IsAnOwnableCar
[19:41:15] 0 playerid, 2 carid IsAnOwnableCar
[19:41:15] 0 playerid, 3 carid IsAnOwnableCar
[19:41:15] 0 playerid, 4 carid IsAnOwnableCar
[19:41:15] 0 playerid, 5 carid IsAnOwnableCar
[19:41:15] 0 playerid, 6 carid IsAnOwnableCar
[19:41:15] 0 playerid, 7 carid IsAnOwnableCar
[19:41:15] 0 playerid, 8 carid IsAnOwnableCar
[19:41:15] 0 playerid, 9 carid IsAnOwnableCar
[19:41:15] 1 playerid, 0 carid IsAnOwnableCar
[19:41:15] 1 playerid, 1 carid IsAnOwnableCar
[19:41:15] 1 playerid, 2 carid IsAnOwnableCar
[19:41:15] 1 playerid, 3 carid IsAnOwnableCar
[19:41:15] 1 playerid, 4 carid IsAnOwnableCar
[19:41:15] 1 playerid, 5 carid IsAnOwnableCar
[19:41:15] 1 playerid, 6 carid IsAnOwnableCar
[19:41:15] 1 playerid, 7 carid IsAnOwnableCar
[19:41:15] 1 playerid, 8 carid IsAnOwnableCar
[19:41:15] 1 playerid, 9 carid IsAnOwnableCar
[19:41:15] 0 playerid, 0 carid IsAnOwnableCar
[19:41:15] 0 playerid, 1 carid IsAnOwnableCar
[19:41:15] 0 playerid, 2 carid IsAnOwnableCar
[19:41:15] 0 playerid, 3 carid IsAnOwnableCar
[19:41:15] 0 playerid, 4 carid IsAnOwnableCar
[19:41:15] 0 playerid, 5 carid IsAnOwnableCar
[19:41:15] 0 playerid, 6 carid IsAnOwnableCar
[19:41:15] 0 playerid, 7 carid IsAnOwnableCar
[19:41:15] 0 playerid, 8 carid IsAnOwnableCar
[19:41:15] 0 playerid, 9 carid IsAnOwnableCar
[19:41:15] 1 playerid, 0 carid IsAnOwnableCar
[19:41:15] 1 playerid, 1 carid IsAnOwnableCar
[19:41:15] 1 playerid, 2 carid IsAnOwnableCar
[19:41:15] 1 playerid, 3 carid IsAnOwnableCar
[19:41:15] 1 playerid, 4 carid IsAnOwnableCar
[19:41:15] 1 playerid, 5 carid IsAnOwnableCar
[19:41:15] 1 playerid, 6 carid IsAnOwnableCar
[19:41:15] 1 playerid, 7 carid IsAnOwnableCar
[19:41:15] 1 playerid, 8 carid IsAnOwnableCar
[19:41:15] 1 playerid, 9 carid IsAnOwnableCar
[19:41:16] 0 playerid, 0 carid IsAnOwnableCar
[19:41:16] 0 playerid, 1 carid IsAnOwnableCar
[19:41:16] 0 playerid, 2 carid IsAnOwnableCar
[19:41:16] 0 playerid, 3 carid IsAnOwnableCar
[19:41:16] 0 playerid, 4 carid IsAnOwnableCar
[19:41:16] 0 playerid, 5 carid IsAnOwnableCar
[19:41:16] 0 playerid, 6 carid IsAnOwnableCar
[19:41:16] 0 playerid, 7 carid IsAnOwnableCar
[19:41:16] 0 playerid, 8 carid IsAnOwnableCar
[19:41:16] 0 playerid, 9 carid IsAnOwnableCar
[19:41:16] 1 playerid, 0 carid IsAnOwnableCar
[19:41:16] 1 playerid, 1 carid IsAnOwnableCar
[19:41:16] 1 playerid, 2 carid IsAnOwnableCar
[19:41:16] 1 playerid, 3 carid IsAnOwnableCar
[19:41:16] 1 playerid, 4 carid IsAnOwnableCar
[19:41:16] 1 playerid, 5 carid IsAnOwnableCar
[19:41:16] 1 playerid, 6 carid IsAnOwnableCar
[19:41:16] 1 playerid, 7 carid IsAnOwnableCar
[19:41:16] 1 playerid, 8 carid IsAnOwnableCar
[19:41:16] 1 playerid, 9 carid IsAnOwnableCar

Nu stiu de la ce este problema dar cred ca din cauza acestei functii server-ul meu se restarteaza / da crash. Daca m-ati putea ajuta sau daca aveti vreo idee este bine-venita. Multumesc.

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

ai functia intr-un timer, si eu daca pun un mesaj in aceasta functie imi apare la infinit

Share this post


Link to post
Share on other sites
  • 0

Da, am aceasta functie in 3 timere, unul verfica fuel-ul la masina, al doilea speedometer-ul iar al treilea kilometrajul. De la aceste timere server-ul se poate restarta?

Share this post


Link to post
Share on other sites
  • 0
Citat

 

nu neaparat, eu am avut odata o comanda care imi dadea crash la server si se inchidea

Share this post


Link to post
Share on other sites
  • 0

Functia asta este sa vezi daca o masina este de "vanzare" sa zic asa dar problema este ca tu incerci sa vezi in functia respectiva daca masina este a respectivului jucator...asa ca ar fi fost mai bine sa faci ceva de genu...

 

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

{

if(VehicleInfo[i / vehicleid][ownable]) return 1;
}

Ti-am dat doar o informatie utila :) nu scriptul complet.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.