06.02.2016, 18:28
The object wont be created, as u see i added printf and won't show up the printf("test2");, hope u guys will be able to help me out
PHP код:
else if(strcmp(choice,"pot",true) == 0)
{
if(PlayerInfo[playerid][pPot] > 0)
{
format(string, sizeof(string), "You have dropped %d grams of pot.", PlayerInfo[playerid][pPot]);
SendClientMessageEx(playerid, COLOR_WHITE, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s has thrown away their pot.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new amount2 = 0, amounto = PlayerInfo[playerid][pPot];
PlayerInfo[playerid][pPot] = 0;
GetPlayerPos(playerid,X,Y,Z);
printf("test");
for(new i = 0; i < sizeof(DropInfo); i++)
{
if(strcmp(GetPlayerNameEx(playerid), DropInfo[i][dpOwner], true) == 0)
{
amount2++;
}
}
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
{
SendClientMessageEx(playerid, COLOR_GREY, "You are not carrying any pot to throw away!");
}
}