setproperty(0, "",48, "FishingRod");
new value[15];
getproperty(0, "",Item[slot][Containid], value);
print(value);
//returns FishingRod *jeeej*
new FISH[15];
getproperty(0, "",Item[c][Containid], FISH);
new Cstring[120];
format(Cstring,sizeof(Cstring),"%s\n%d\n%s\n%d",FISH ,Item[c][ItemAmmount],Item[c][Containid2],Item[c][ItemAmmount2]);
CreateItem(objectid,Name[],ID,Float:X, Float:Y, Float:Z,iworld,iint,contains,ammount,contains2,ammount2)// contains[],
{
new slot = -1;
for(new i = 0; i < MAX_ITEMS; i ++)
{
if(Item[i][picked]) continue;
slot = i;
break;
}
if(slot == -1) return -1; // No free Slot
Item[slot][ItemObject] = objectid;
Item[slot][Itemid] = ID;
Item[slot][DI][0] = X;
Item[slot][DI][1] = Y;
Item[slot][DI][2] = Z;
Item[slot][ItemWorld] = iworld;
Item[slot][ItemInt] = iint;
Item[slot][Containid] = contains;
Item[slot][ItemAmmount] = ammount;
Item[slot][Containid2] = contains2;
Item[slot][ItemAmmount2] = ammount2;
format(Item[slot][ItemName], 24, Name);
new value[15];
getproperty(0, "",Item[slot][Containid], value);
print(value);
//-----------------------
Item[slot][I_Areaid] = CreateDynamicSphere(X, Y, Z, 2.0, iworld, iint, -1);//2.0 is area size
Streamer_SetIntData(STREAMER_TYPE_AREA, Item[slot][I_Areaid], E_STREAMER_EXTRA_ID, slot); //i know what it does but not why :S
Item[slot][I_Objectid] = CreateDynamicObject(objectid, X, Y, Z, 0.0, 0.0, 0.0, iworld, iint, -1, 50.0, 50.0);
Item[slot][picked] = true;
return slot;
}
for(new c = 0; c < MAX_ITEMS; c ++)
if(IsPlayerInDynamicArea(playerid,Item[c][Itemid]))
{
//check if crate is empty ( empty dialog makes you crash )
if(Item[c][Containid]<=0 && Item[c][Containid2] <= 0 && Item[c][ItemAmmount]<= 0 && Item[c][ItemAmmount2]<= 0)return SendClientMessage(playerid,COLOR_WHITE,"empty");
else
{
new Nstring[20];
format(Nstring,sizeof(Nstring),"%s contains",Item[c][ItemName]);//header of dialog
if(Item[c][Containid] <=46||Item[c][Containid2] <=46)//check if its weapons first then get the name
{
new gunname[32],gunname2[32],Wstring[100];
GetWeaponName(Item[c][Containid],gunname,sizeof(gunname));
GetWeaponName(Item[c][Containid2],gunname2,sizeof(gunname2));
format(Wstring,sizeof(Wstring),"%s\n%s",gunname,gunname2);
ShowPlayerDialog(playerid,W_CONTANCE,DIALOG_STYLE_LIST,Nstring,Wstring,"get","leave");
}
if(Item[c][Containid] >46||Item[c][Containid2]>46) // if item is not a weapon
{
new VL[15];
getproperty(0, "",Item[c][Containid], VL);
//strunpack(VL,VL);
new Cstring[120];
format(Cstring,sizeof(Cstring),"%s\n%d\n%s\n%d",getproperty(0, "",Item[c][Containid], VL),Item[c][ItemAmmount],Item[c][Containid2],Item[c][ItemAmmount2]);
ShowPlayerDialog(playerid,CONTANCE,DIALOG_STYLE_LIST,Nstring,Cstring,"get","leave");
print(VL);
}
}
}
This is because property returns packed string. You need to unpack it (with strunpack()), when using format(), or working on it.
|