07.02.2016, 12:26
Ok then it's obvious that "test2" is not shown
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.
would be a solution for the server to do something in the case of a value higher than 2.
Код:
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;
}
}
}
Код:
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
}

