Drop Help
#6

Ok then it's obvious that "test2" is not shown
Код:
if(amount2 <= 2) 
               { 
               for(new i = 0; i < sizeof(DropInfo); i++) 
                 { 
                      printf("test2"); 
                     if(DropInfo[i][dpX] == 0.0 && DropInfo[i][dpY] == 0.0 && DropInfo[i][dpZ] == 0.0) 
                   { 
                         strmid(DropInfo[i][dpOwner], GetPlayerNameEx(playerid), 0, strlen(GetPlayerNameEx(playerid)), 255); 
                         DropInfo[i][dpAmmo] = amounto; 
                         DropInfo[i][dpX] = X; 
                         DropInfo[i][dpY] = Y; 
                         DropInfo[i][dpZ] = Z; 
                         DropInfo[i][dpWorld] = GetPlayerVirtualWorld(playerid); 
                         DropInfo[i][dpType] = 2; 
                         DropInfo[i][dpObject] = CreateDynamicObject(1578, X, Y, Z-1, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid)); 
                       return 1; 
                       } 
                  } 
              }
On this you check if "amount2" has avalue lower or equally than/to "2". As the value is 500, it is higher than 2 and therefor the code in the if condition is going to be ignored.
Код:
if(amount2 <= 2)
               	{
               		for(new i = 0; i < sizeof(DropInfo); i++)
                 	{
                  		printf("test2");
                     	if(DropInfo[i][dpX] == 0.0 && DropInfo[i][dpY] == 0.0 && DropInfo[i][dpZ] == 0.0)
                   		{
                     		strmid(DropInfo[i][dpOwner], GetPlayerNameEx(playerid), 0, strlen(GetPlayerNameEx(playerid)), 255);
                         	DropInfo[i][dpAmmo] = amounto;
                         	DropInfo[i][dpX] = X;
                         	DropInfo[i][dpY] = Y;
                         	DropInfo[i][dpZ] = Z;
                         	DropInfo[i][dpWorld] = GetPlayerVirtualWorld(playerid);
                         	DropInfo[i][dpType] = 2;
                         	DropInfo[i][dpObject] = CreateDynamicObject(1578, X, Y, Z-1, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid));
                       		return 1;
                       	}
                  	}
              	}
              	else
				{
				    printf("test3, amount is higher than 2, as it's %d", amount2);
				    //some other code if you want
				}
would be a solution for the server to do something in the case of a value higher than 2.
Reply


Messages In This Thread
Drop Help - by N0FeaR - 06.02.2016, 18:28
Re: Drop Help - by Sascha - 06.02.2016, 18:54
Re: Drop Help - by N0FeaR - 06.02.2016, 19:24
Re: Drop Help - by Sascha - 06.02.2016, 20:36
Re: Drop Help - by N0FeaR - 07.02.2016, 08:46
Re: Drop Help - by Sascha - 07.02.2016, 12:26

Forum Jump:


Users browsing this thread: 1 Guest(s)