08.05.2018, 22:20
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); new bool:TemSlot = false; 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]; TemSlot = true; break; } } if(!TemSlot) return SendClientMessage(playerid, 0xFF3080AA, "Seu inventбrio estб cheio!"); 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, 0xFF3080AA, str); DestroyDroppedObjectItem(f); SalvarInventario(playerid); ApplyAnimation(playerid,"BOMBER","BOM_Plant_2Idle",4.1,0,1,1,0,0); return 1; }