08.05.2018, 22:06
PHP Code:
CMD:pitem(playerid)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.8, dItemData[a][ObjtPos][0], dItemData[a][ObjtPos][1], dItemData[a][ObjtPos][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return 1;
if(gettime() < GetPVarInt(playerid, #VarFlood8))
return 1;
SetPVarInt(playerid, #VarFlood8, gettime()+2);
for(new i=0; i<75; i++)
{
if(InventarioInfo[playerid][i][iSlot] == 19382)
{
InventarioInfo[playerid][i][iSlot] = dItemData[f][ObjtData][0];
InventarioInfo[playerid][i][iUnidades] = dItemData[f][ObjtData][1];
break;
}
}
new str[256];
format(str, sizeof str, "* Vocк pegou um item: %s, com %d unidade(s)", NomeItemID(dItemData[f][ObjtData][0]), dItemData[f][ObjtData][1]);
SendClientMessage(playerid, 0x00ccccFF, str);
DestroyDroppedObjectItem(f);
ApplyAnimation(playerid,"BOMBER","BOM_Plant_2Idle",4.1,0,1,1,0,0);
return 1;
}